This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Re: Bug in g77 and D format


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.

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