This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

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)


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