This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

g77 bug, double precision


> The following definition

>         real *8 x /1E15/, y /1D15/

> would not be equal after compiling.

> x would have a value of 9.99999987E+14
> while y would have the correct value of 1.0E+15

Fascinating - even if we make this code completely Standard Conforming:

        DOUBLE PRECISION x, y
        DATA  x /1e15/, y /1d15/
        print *,x.eq.y
        print *,x,y
        end

it still fails ...

 F
  9.99999987E+14  1.E+15

[ GNU F77 version egcs-2.91.59 19981124 (egcs-1.1.1 pre-release #3)
(i686-pc-linux-gnu) compiled by GNU C version egcs-2.91.59 19981124)
 (egcs-1.1.1 pre-release #3) ]

Both in single and double precision IEEE-754 format, 10**15 is exactly
representable.  This means something is wrong in single precision REAL
constant processing - Craig, do you know where this happens ?

Cheers,

-- 
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
g77 Support: fortran@gnu.org; egcs: egcs-bugs@cygnus.com


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