This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
fix execute/intrinsic_nearest.f90
- From: Richard Henderson <rth at redhat dot com>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 Jul 2004 11:28:34 -0700
- Subject: fix execute/intrinsic_nearest.f90
This allows the test to pass on i686 and (if I force -mieee) on alpha.
The wording from the F2003 standard for NEAREST matches the wording
for C99 nextafter, so I assume from that denormals are fair game.
Ok?
r~
Index: execute/intrinsic_nearest.f90
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_nearest.f90,v
retrieving revision 1.3
diff -c -p -d -r1.3 intrinsic_nearest.f90
*** execute/intrinsic_nearest.f90 30 Jun 2004 11:50:45 -0000 1.3
--- execute/intrinsic_nearest.f90 30 Jul 2004 18:24:37 -0000
***************
*** 2,11 ****
program test_nearest
real s, r, x, y, inf, max, min
! integer i, infi, maxi
equivalence (s,i)
equivalence (inf,infi)
equivalence (max,maxi)
r = 2.0
s = 3.0
--- 2,12 ----
program test_nearest
real s, r, x, y, inf, max, min
! integer i, infi, maxi, mini
equivalence (s,i)
equivalence (inf,infi)
equivalence (max,maxi)
+ equivalence (min,mini)
r = 2.0
s = 3.0
*************** program test_nearest
*** 27,33 ****
infi = z'7f800000'
maxi = z'7f7fffff'
! min = tiny(1.0)
call test_up(max, inf)
call test_up(-inf, -max)
--- 28,37 ----
infi = z'7f800000'
maxi = z'7f7fffff'
! ! Note that NEAREST operates on machine-representable numbers, rather
! ! than model numbers. Thus TINY gives the wrong answer when denormals
! ! are supported. This test program is already pretty IEEE specific...
! mini = z'00000001'
call test_up(max, inf)
call test_up(-inf, -max)