From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5517 invoked by alias); 24 Jan 2011 12:56:40 -0000 Received: (qmail 5502 invoked by uid 22791); 24 Jan 2011 12:56:39 -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; Mon, 24 Jan 2011 12:56:35 +0000 From: "thenlich at users dot sourceforge.net" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/47434] New: Wrong field width for NaN with (F0.n) formatting 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" MIME-Version: 1.0 Date: Mon, 24 Jan 2011 13:19: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-01/txt/msg02443.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47434 Summary: Wrong field width for NaN with (F0.n) formatting Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libfortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: thenlich@users.sourceforge.net When formatting NaN with a F edit descriptor where the field width is zero, the string "NaN" is written (field width = 4). The expected string would be "NaN" (field width = 3, the smallest positive actual field width that does not result in a field filled with asterisks). For example: program testnan real :: n = 0.0 n = 0.0 / n print "(F0.2)", n print "(F3.2)", n end program testnan Output: NaN NaN 10.7.2.1 (6) On output, with I, B, O, Z, F, and G editing, the specified value of the field width w may be zero. In such cases, the processor selects the smallest positive actual field width that does not result in a field filled with asterisks. The specified value of w shall not be zero on input. 10.7.2.3.2 F editing For an internal value that is an IEEE NaN, the output field consists of blanks, if necessary, followed by the letters 'NaN' and optionally followed by one to w - 5 alphanumeric processor-dependent characters enclosed in parentheses, right justified within the field. If w is less than 3, the field is filled with asterisks.