This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/48906] Wrong rounding results with -m32
- From: "thenlich at users dot sourceforge.net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 6 Jun 2011 12:48:19 +0000
- Subject: [Bug libfortran/48906] Wrong rounding results with -m32
- Auto-submitted: auto-generated
- References: <bug-48906-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48906
--- Comment #29 from Thomas Henlich <thenlich at users dot sourceforge.net> 2011-06-06 12:47:58 UTC ---
(In reply to comment #27)
> >
> > print "(-2pg12.3)", 0.02 ! 0.200E-01 expected 0.002E+01
> > print "(-1pg12.3)", 0.02 ! 0.200E-01 expected 0.020E+00
> > print "(0pg12.3)", 0.02 ! 0.200E-01
> > print "(1pg12.3)", 0.02 ! 0.200E-01 expected 2.000E-02 < Too many significant digits?
> > print "(2pg12.3)", 0.02 ! 0.200E-01 expected 20.00E-03 < Too many significant digits?
>
> Should these last two cases by 2.00E-02 and 20.0E-03 ? Otherwise we seem to be
> adding an extra significant digit.
>
> Help me understand this.
Don't worry, it's not your fault... Say goodbye to the world of common sense,
welcome to the world of the Fortran standard! ;-)
"The scale factor k controls the decimal normalization (10.3.2, 10.8.5). If âd
< k <= 0, the output field contains exactly |k| leading zeros and d â |k|
significant digits after the decimal symbol. If 0 < k < d + 2, the output field
contains exactly k significant digits to the left of the decimal symbol and d â
k + 1 significant digits to the right of the decimal symbol. Other values of k
are not permitted."