public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/47945] New: REAL(8) output conversion error on MinGW32
@ 2011-03-01 14:00 thenlich at users dot sourceforge.net
  2011-03-01 14:01 ` [Bug libfortran/47945] " thenlich at users dot sourceforge.net
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: thenlich at users dot sourceforge.net @ 2011-03-01 14:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47945

           Summary: REAL(8) output conversion error on MinGW32
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: thenlich@users.sourceforge.net


The last digits of REAL(8) numbers are converted inaccurately on output.

For instance, the output of:

real(8) :: r8
real(16) :: r16

r8 = .14285714285714286d0
r16 = r8
write(*, '(f35.32)') r8
write(*, '(f35.32)') r16
end

is:
 0.14285714285714284921875000000000
 0.14285714285714284921269268124888

but the expected output is:
 0.14285714285714284921269268124888
 0.14285714285714284921269268124888

because the internal 64-bit representation of .14285714285714286 is
approximately equal to 0.14285714285714284921269268124888...

Arguably, an output of 0.14285714285714285000000000000000 would equally be
acceptable, because it is the shortest decimal representation of the same
internal value. (This is in fact what the GCC C Compiler on mingw32 does)


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2011-03-04  6:57 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-01 14:00 [Bug libfortran/47945] New: REAL(8) output conversion error on MinGW32 thenlich at users dot sourceforge.net
2011-03-01 14:01 ` [Bug libfortran/47945] " thenlich at users dot sourceforge.net
2011-03-01 14:02 ` thenlich at users dot sourceforge.net
2011-03-01 14:28 ` schwab@linux-m68k.org
2011-03-01 14:45 ` thenlich at users dot sourceforge.net
2011-03-02  0:22 ` jvdelisle at gcc dot gnu.org
2011-03-02  6:45 ` thenlich at users dot sourceforge.net
2011-03-02  7:14 ` kargl at gcc dot gnu.org
2011-03-02  7:25 ` burnus at gcc dot gnu.org
2011-03-02 13:49 ` thenlich at users dot sourceforge.net
2011-03-02 16:45 ` burnus at gcc dot gnu.org
2011-03-02 17:04 ` burnus at gcc dot gnu.org
2011-03-02 17:54 ` thenlich at users dot sourceforge.net
2011-03-02 18:02 ` burnus at gcc dot gnu.org
2011-03-02 18:17 ` sgk at troutmask dot apl.washington.edu
2011-03-03 14:04 ` jb at gcc dot gnu.org
2011-03-03 14:58 ` thenlich at users dot sourceforge.net
2011-03-04  6:48 ` thenlich at users dot sourceforge.net
2011-03-04  6:53 ` thenlich at users dot sourceforge.net
2011-03-04  6:54 ` thenlich at users dot sourceforge.net
2011-03-04  6:57 ` thenlich at users dot sourceforge.net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).