public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/48615] New: Invalid UP/DOWN rounding with E and ES descriptors
@ 2011-04-15  7:08 thenlich at users dot sourceforge.net
  2011-04-23  7:49 ` [Bug libfortran/48615] " thenlich at users dot sourceforge.net
                   ` (15 more replies)
  0 siblings, 16 replies; 18+ messages in thread
From: thenlich at users dot sourceforge.net @ 2011-04-15  7:08 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Invalid UP/DOWN rounding with E and ES descriptors
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: thenlich@users.sourceforge.net


The E and ES descriptors ignore the I/O rounding mode:

print "(RU,F17.0)", 1.1
print "(RU,G17.1)", 1.1e9
print "(RU,E17.1)", 1.1e9 ! 0.1E+10 expected 0.2E+10
print "(RU,ES17.0)", 1.1e9  ! 1.E+09 expected 2.E+09
print "(RU,EN17.0)", 1.1e9

print "(RD,F17.0)", 1.9
print "(RD,G17.1)", 1.9e9
print "(RD,E17.1)", 1.9e9   ! 0.2E+10 expected 0.1E+10
print "(RD,ES17.0)", 1.9e9  ! 2.E+09 expected 1.E+09
print "(RD,EN17.0)", 1.9e9
end

Fortran 2008:
10.7.2.3.3 E and D editing
4 ...
- x1 x2 ... xd are the d most significant digits of the internal value after
rounding (10.7.2.3.7);

10.7.2.3.5 ES editing
5 ...
- y is a decimal digit representative of the most significant digit of the
internal value after rounding (10.7.2.3.7);
- signifies a decimal symbol (10.6);
- x1 x2 ... xd are the d next most significant digits of the internal value
after rounding;

10.7.2.3.7 I/O rounding mode
3 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. When the I/O rounding mode is DOWN, the value resulting
from conversion shall be the largest representable value that is less than or
equal to the original value.


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

end of thread, other threads:[~2013-01-06 14:13 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-15  7:08 [Bug libfortran/48615] New: Invalid UP/DOWN rounding with E and ES descriptors thenlich at users dot sourceforge.net
2011-04-23  7:49 ` [Bug libfortran/48615] " thenlich at users dot sourceforge.net
2011-04-23 11:07 ` thenlich at users dot sourceforge.net
2011-04-23 12:24 ` jvdelisle at gcc dot gnu.org
2011-04-23 13:20 ` thenlich at users dot sourceforge.net
2011-04-23 16:33 ` jvdelisle at gcc dot gnu.org
2011-04-23 17:04 ` thenlich at users dot sourceforge.net
2011-04-24 20:34 ` jvdelisle at gcc dot gnu.org
2011-04-24 21:41 ` thenlich at users dot sourceforge.net
2011-04-24 23:24   ` Jerry DeLisle
2011-04-24 23:25 ` jvdelisle at frontier dot com
2011-04-24 23:43 ` jvdelisle at gcc dot gnu.org
2011-04-24 23:54 ` jvdelisle at frontier dot com
2011-04-25  8:44 ` thenlich at users dot sourceforge.net
2011-04-29 15:03 ` jvdelisle at gcc dot gnu.org
2011-04-29 15:11 ` jvdelisle at gcc dot gnu.org
2011-05-06 20:14 ` jvdelisle at gcc dot gnu.org
2013-01-06 14:13 ` burnus 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).