This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

writing a double precission varibale with format f3.0 is not rounded


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)


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