This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bug in g77 and D format
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Re: Bug in g77 and D format
- From: toon at moene dot indiv dot nluug dot nl
- Date: 27 Jan 2000
Martin Kahlert wrote:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Here is a small bug in g77's io regarding the d-format.
I seems, that the d fromat is silently changed into the e format:
REAL*8 T
T = 1D-8
WRITE(*,'(D16.4)') T
WRITE(*,'(E16.4)') T
END
The prog prints:
0.1000E-07
0.1000E-07
instead of
0.1000D-07
0.1000E-07
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Unfortunately, I have to say that this is Standard Fortran 77 - how strange
it may seem. The type of the I/O item is not determined by a D or an E, but
by the type of the variable receiving the value (in case of a read) or
supplying it (in case of a write).
The type is *not* related to the appearance of a D or an E in the I/O item
to be read/written.
[Yes, I know - this is definitely inconsistent with the appearence of a
real/double precision constant in Fortran source code ... Hey, I didn't
come up with this scheme ;-) ]
Hope this helps,
Toon.