This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/34209] run-time lib: NEAREST(0.0_8, -1.0) produces wrong numbers
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Nov 2007 20:50:58 -0000
- Subject: [Bug libfortran/34209] run-time lib: NEAREST(0.0_8, -1.0) produces wrong numbers
- References: <bug-34209-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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