[Bug fortran/40675] sign intrinsic fails for value of 0.0

dominiq at lps dot ens dot fr gcc-bugzilla@gcc.gnu.org
Tue Jul 7 19:53:00 GMT 2009



------- Comment #4 from dominiq at lps dot ens dot fr  2009-07-07 19:53 -------
Steven beats me with the f95 standard: sign(0.5,-0.0) shall give -0.5.

Note that the code in comment #0 gives 'pass' with ifort but fails with g77.
I think the code is invalid since mysign is implicitely typed as integer.
In addition I don't understand how it works with ifort:
if sign(0.5,0.0) and sign(0.5,-0.0) are expected to give 0.5, then test=0.0 and
test2=0.5.

May be one could consider to ignore signed zero in SIGN with -std=legacy(?).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40675



More information about the Gcc-bugs mailing list