This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/48602] New: Invalid F conversion of G descriptor for values close to powers of 10
- From: "thenlich at users dot sourceforge.net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 14 Apr 2011 08:02:09 +0000
- Subject: [Bug libfortran/48602] New: Invalid F conversion of G descriptor for values close to powers of 10
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: thenlich@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