reading doubles with I and writing integers with F
Evgenii Rudnyi
Evgenii@Rudnyi.Ru
Thu Jan 6 22:07:00 GMT 2005
Hi,
I was porting my very old Fortran code to g77:
gcc version 3.4 20031015 (experimental) on my Mac
gcc version 3.2.3 on Sun
I have found some strange, in my view, behavior.
1) Printing integers by F format does not work
print '(F10.3)', 1
end
produces
0.000
2) Reading doubles with I format does not work either
real*8 a
character b
b = '6 '
read (b, '(i2)'),a
print *,a
read (b, '(f2.0)'),a
print *,a
end
produces
2.96439388E-323
6.
In the old good time both examples produced what one would expect (at
least with Lahey). I have not checked the Fortran standard as I do not
program in Fortran nowadays. Still, it would be interesting to know
what it is: a feature or a bug.
Best wishes,
Evgenii Rudnyi
--
http://Evgenii.Rudnyi.Ru
More information about the Fortran
mailing list