http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48787
Summary: Invalid UP rounding with F editing
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: libfortran
AssignedTo: [email protected]
ReportedBy: [email protected]
When UP output rounding is in effect, the output of F editing is rounded
incorrectly. In the example, real numbers with an exact internal representation
(whole numbers) are rounded up to the next higher value.
program test_ruf
print "(ru,f2.0)", 2.0_4 ! 3. expected 2.
print "(ru,f2.0)", 2.0_8 ! 3. expected 2.
print "(ru,f2.0)", 2.0_10 ! 3. expected 2.
print "(ru,f2.0)", 2.0_16 ! 3. expected 2.
end program test_ruf
Tested with gcc-Version 4.7.0 20110424 (experimental) [trunk revision 172919]
(GCC)
Fortran 2008:
When the I/O rounding mode is UP, the value resulting from conversion shall be
the smallest representable value that is greater than or equal to the original
value.