This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/30694] minval/maxval with +/-Inf
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Mar 2007 09:49:49 -0000
- Subject: [Bug libfortran/30694] minval/maxval with +/-Inf
- References: <bug-30694-10391@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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