questionnable nint() behavior
Dominique Dhumieres
dominiq@lps.ens.fr
Mon Mar 20 21:56:00 GMT 2006
> depends on the options passed to gfortran:
Not for me on linus-AMD64 or OSX-G5:
[akira] test/fortran> gfc -O -Wall -pedantic prec.f
[akira] test/fortran> a.out
nint (8388609.0) = 8388610
nint (0.49999997) = 1, where y < 0.5 = T
> I don't know which you are arguing is correct.
8388610 is clearly wrong since 8388609.0 is an integer.
For 0.49999997, since it is recognized as < 0.5
my reading of the standard is that nint() should
return 0.
Dominique
More information about the Fortran
mailing list