[Bug libfortran/34209] run-time lib: NEAREST(0.0_8, -1.0) produces wrong numbers
jvdelisle at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Nov 23 20:51:00 GMT 2007
------- Comment #2 from jvdelisle at gcc dot gnu dot org 2007-11-23 20:50 -------
With the patch for PR34192 and using the following:
program test
implicit none
real(8), volatile :: r8
r8 = 0.0_8
print *, nearest(r8, 1.0_8)
print *, nearest(nearest(r8, 1.0_8), 1.0_8)
print *, nearest(nearest(r8, 1.0_8),-1.0_8)
end program test
I get the expected result. The kind of the second argument of nearest appears
to matter.
$ ./a.out
4.94065645841246544E-324
9.88131291682493088E-324
0.0000000000000000
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34209
More information about the Gcc-bugs
mailing list