This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/30910] [Regression 4.2, 4.3] Gfortran: ES format not quite right...



------- 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


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