This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: writing a double precission varibale with format f3.0 is not rounded
- From: Tobias Burnus <burnus at net-b dot de>
- To: HugoMahr at web dot de
- Cc: fortran at gcc dot gnu dot org
- Date: Tue, 16 Jan 2007 15:35:37 +0100
- Subject: Re: writing a double precission varibale with format f3.0 is not rounded
- References: <200701161512.39444.HugoMahr@web.de>
Hello,
Hugo Mahr wrote:
> I realized that there is a rounding probelm:
> Code:
> -> cat f0999.f
> double precision rdum
> rdum = 9.99999D-1
> write(*,'(F3.0)') rdum
> -> ./a.out
> 0.
> 0.999999D+00
> I expect 1 as outcome instead of 0.999999d0.
>
This is indeed a bug in gfortran (thanks for reporting); this bug is
however fixed in GCC 4.2 (next release) and in GCC 4.3 (development
version).
I do not think it will be fixed in 4.1.0 (limited man power). I
therefore would suggest to update to 4.2 (or 4.3). Fortranwise I think
4.3 is even a bit more bugfree than 4.2, but as it is actively
developed, it may work or not depending on the day it has been
downloaded (by far the most time it works though).
Daily builds for GCC 4.3 (and for AMD64 also 4.2) are available at
http://gcc.gnu.org/wiki/GFortranBinaries
Probably more interestingly: There are GCC 4.2 RPM builds available for
SLE 10, SUSE Linux 10.1 and for openSUSE 10.2 and Factory. These are
build by Richard Günther which takes also care of the official SUSE builds.
http://software.opensuse.org/download/home:/rguenther/
Note 1: Unfortunally, the ABI between 4.1 and 4.2 is incompatible, i.e.
you need to recompile the libraries (e.g. BLAS, LAPACK etc.) in order to
use them. (Installing 4.1 and 4.2 besides each other is no problem,
which allows to continue using programs compiled with 4.1.)
Note 2: Currently, the ABI between 4.2 and 4.3 is the same, but this is
due to change in the next days.
Tobias