[Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...
burnus at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Feb 22 13:50:00 GMT 2007
------- 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
More information about the Gcc-bugs
mailing list