This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Feb 2007 13:50:13 -0000
- Subject: [Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
- References: <bug-30910-13399@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from burnus at gcc dot gnu dot org 2007-02-22 13:50 -------
I think I found why the output is wrong. The following condition has been
introduced 2006-08-27 with the patch
http://gcc.gnu.org/viewcvs?view=rev&revision=116502
Before the "if" the value is 0.1, afterwards it is 0.0.
/* Special case when format specifies no digits after the decimal point. */
if (d == 0)
{
if (value < 0.5)
value = 0.0;
else if (value < 1.0)
value = value + 0.5;
}
The changelog of that patch is:
PR libgfortran/28354
* io/write.c: Check for special case of zero precision in format
and pre-round the real value.
which fixed the bug "0.99999 printed as 0. instead of 1. by format(f3.0)"
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30910