Failure of default_format_1.f90

Dominique Dhumieres dominiq@lps.ens.fr
Thu Oct 4 09:39:00 GMT 2007


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



More information about the Fortran mailing list