http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48602
Summary: Invalid F conversion of G descriptor for values close to powers of 10 Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libfortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: thenl...@users.sourceforge.net Created attachment 23976 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23976 Test case Libfortran does not correctly implement the G conversion method from Fortran 2008 10.7.5.2.2(4) for the UP and DOWN I/O rounding modes. The number of significant digits d is incorrect in some cases where the magnitude of the internal value is close to a power of 10. For instance print "(RU,G15.2)", .991d0 prints 1.00 but the expected result is 1.0 because 1 - r * 10**-2 < .991 with r = 1 because of UP rounding mode print "(RD,G15,2)", .996d0 prints 0.9 but expected is 0.99 because .996 < 1 - r * 10**-2 with r = 0 because of DOWN rounding mode