This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Failure of default_format_1.f90
- From: dominiq at lps dot ens dot fr (Dominique Dhumieres)
- To: fortran at gcc dot gnu dot org
- Date: Thu, 04 Oct 2007 11:39:49 +0200
- Subject: 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