public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/47945] REAL(8) output conversion error on MinGW32
Date: Wed, 02 Mar 2011 07:25:00 -0000	[thread overview]
Message-ID: <bug-47945-4-bZoeDanfJT@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47945-4@http.gcc.gnu.org/bugzilla/>

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-03-02 07:24:57 UTC ---
It is not completely clear to me what you get for your C test case. My feeling
is that the differences are due to the use of different "printf" routines.

For "double" or "REAL(8)", I think Microsoft's snprintf is used - while for
__float128 or REAL(16) a GLIBC-based snprintf is used in libquadmath.

Not surprisingly, I get on Linux the r16 result - which makes sense as all
snprintf routines are based on GLIBC (program from comment 6)
 0.14285714285714284921269268124888
 0.14285714285714284921269268124888

As both numbers are IEEE identical, one cannot really say that Microsoft libc's
implementation or libquadmath's is wrong.

Note: You could use libquadmath with __float128 also from C, cf.
http://gcc.gnu.org/onlinedocs/libquadmath/quadmath_005fsnprintf.html


(In reply to comment #7)
> > 10.7.2.3.7 I/O rounding mode
> 
> gfortran is not a F2008 compiler and it currently does not support
> I/O rounding modes.

To my knowledge gfortran supports I/O rounding (for output, not for input)
since 4.5.0. However, it neither supports setting the rounding for run-time
arithmetic via F2003's IEEE modules -- nor does it allow to set the rounding
for compile-time simplification (folding).

Besides, I am not really sure whether rounding is/should work if one ask for
more digits than the number actually has...

(I think Steve talked about the compile-time folding when he wrote: gfortran by
default will use round to nearest.)


  parent reply	other threads:[~2011-03-02  7:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01 14:00 [Bug libfortran/47945] New: " 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-47945-4-bZoeDanfJT@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).