This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
writing a double precission varibale with format f3.0 is not rounded
- From: Hugo Mahr <HugoMahr at web dot de>
- To: fortran at gcc dot gnu dot org
- Date: Tue, 16 Jan 2007 15:12:39 +0100
- Subject: writing a double precission varibale with format f3.0 is not rounded
- Reply-to: HugoMahr at web dot de
Hello,
I realized that there is a rounding probelm:
Code:
-> cat f0999.f
program f0999
double precision rdum
rdum = 9.99999D-1
write(*,'(F3.0)') rdum
write(*,'(d24.6)') rdum
end
compilation:
-> gfortran f0999.f
execution:
-> ./a.out
0.
0.999999D+00
I expect 1 as outcome instead of 0.999999d0.
With f77 that is working as expected - and this
is also according to the book fortran 95/2003 explained.
Can you please help me to clarify this.
fortran --version
GNU Fortran 95 (GCC) 4.1.0 (SUSE Linux)