public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/48878] New: Default I/O rounding on output should be round to nearest
@ 2011-05-05  4:26 jb at gcc dot gnu.org
  2011-05-05 13:00 ` [Bug libfortran/48878] " jvdelisle at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jb at gcc dot gnu.org @ 2011-05-05  4:26 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Default I/O rounding on output should be round to
                    nearest
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jb@gcc.gnu.org


When the IO rounding mode is not specified or is specified as
PROCESSOR_DEFINED, we should use NEAREST (corresponding to roundTiesToEven in
IEEE 754-2008). Currently we use COMPATIBLE (corresponding to roundTiestToAway
in IEEE 754-2008).

- Nearest is the default rounding mode for FP arithmetic.

- This is what most libc implementations use.

- As we don't support rounding on input, due to the above most likely nearest
will be used on input.

- Nearest rounding is usually preferable to compatible due to avoiding
positive/negative bias for positive/negative values. 

Alternatively, we could take care to always specify the correct number digits
to use when calling snprintf() when using PROCESSOR_DEFINED or unspecified
rounding, and then skip our own rounding step thus saving a bit of cpu time.


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

end of thread, other threads:[~2012-03-15 15:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-05  4:26 [Bug libfortran/48878] New: Default I/O rounding on output should be round to nearest jb at gcc dot gnu.org
2011-05-05 13:00 ` [Bug libfortran/48878] " jvdelisle at gcc dot gnu.org
2012-03-15 15:16 ` jb at gcc dot gnu.org
2012-03-15 15:21 ` jb at gcc dot gnu.org

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