Formatted Read Accuracy
Thu Oct 10 14:28:00 GMT 2002
Emil Block wrote:
> I have confirmed with a debuger (and write statements) that "line" indeed
> contains 67.9936, and after the read the value is 67.9935989 with G77 and is
> 67.9936 with F77.
I'm afraid I just don't see your problem.
I tried the following complete, stand-alone program:
$ cat trivial.f
$ g77 trivial.f
The second `67.9936' is the output of the program - seems perfectly OK
to me ...
Now, if you really want to be scared s***less, try the following with
your favourite Fortran compiler:
$ cat trivial2.f
$ <fortran-compiler> trivial2.f
???? <- Scary, ain't it :-)
Floating point arithmetic - not for the faint-of-heart.
Toon Moene - mailto:firstname.lastname@example.org - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)
More information about the Gcc-help