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: unassig...@gcc.gnu.org
        ReportedBy: j...@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.

Reply via email to