From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22214 invoked by alias); 15 Apr 2011 07:08:20 -0000 Received: (qmail 22203 invoked by uid 22791); 15 Apr 2011 07:08:19 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Apr 2011 07:08:15 +0000 From: "thenlich at users dot sourceforge.net" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/48615] New: Invalid UP/DOWN rounding with E and ES descriptors X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: thenlich at users dot sourceforge.net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Fri, 15 Apr 2011 07:08:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg01477.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D48615 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); - signi=EF=AC=81es 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 sha= ll 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.