The following program

program chop
  real o, t, td, tu, x, y
  o = 1.
  t = tiny(o)
  td = nearest(t,-1.0)
  x = td/2.0
  y = nearest(tiny(o),-1.0)/2.0
  print *, x, y, x - y
end program chop

gives

  5.8774718E-39  5.8774704E-39  1.4012985E-45

on OSX 10.3.9 and GNU Fortran 95 (GCC) 4.2.0 20060401 (experimental).
I.e, nearest(tiny(o),-1.0)/2.0 does not give the same result as

  td = nearest(t,-1.0)
  x = td/2.0

Dominique


-- 
           Summary: Problem with nearest(tiny(o),-1.0)/2.0
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dominiq at lps dot ens dot fr


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

Reply via email to