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]

Re: Failure of default_format_1.f90


I have compared the result of a WRITE() of denormalized numbers with those of 
Mathematica: if I use 1PG40.25E3, the last failure for 1000 trials is 
4503599627369497*2**(-1074) read as 4503599627369496*2**(-1074) considered 
as exact numbers.

With 30 digits Mathematica returns:

2.22507385850670781151003731203*10**(-308)
2.22507385850670731744439147079*10**(-308)

and with 25 digits gfortran returns:

2.2250738585067078115100373E-308
2.2250738585067073174443915E-308

So (1) formatted WRITE() cranks the asked number of digits as if the floating
point representation was exacti (I did not check for an upper limit).

(2) There is a rounding to even in the READ() on some platform:
Darwin, *BSD, ...

Dominique


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