------- Comment #10 from fxcoudert at gcc dot gnu dot org  2007-03-25 11:49 
-------
$ cat nan.f90             
  real :: nan, x
  x = 7.2
  nan = 0.0
  nan = nan / nan

  print *, minval((/ nan, x /)), maxval((/ nan, x /))
  print *, minval((/ nan /)), maxval((/ nan /))

  print *, minloc((/ nan, x /)), maxloc((/ nan, x /))
  print *, minloc((/ nan /)), maxloc((/ nan /))
  end
$ gfortran nan.f90 && ./a.out
   7.200000       7.200000    
  3.4028235E+38 -3.4028235E+38
           1           1
           1           1

While the results for {MIN,MAX}VAL, while not perfect, are not so bad (it's a
possible interpretation of the standard), the results for {MIN,MAX}LOC are very
annoying: it means that ARRAY(MAXLOC(ARRAY)) /= MAXVAL(ARRAY) !


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org


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

Reply via email to