This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libfortran/34209] run-time lib: NEAREST(0.0_8, -1.0) produces wrong numbers



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]