From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25051 invoked by alias); 27 Jan 2011 13:25:40 -0000 Received: (qmail 25040 invoked by uid 22791); 27 Jan 2011 13:25:40 -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; Thu, 27 Jan 2011 13:25:35 +0000 From: "thenlich at users dot sourceforge.net" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/47434] Wrong field width for NaN with (F0.n) formatting X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jvdelisle at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 27 Jan 2011 14:01: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/msg02957.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47434 --- Comment #5 from Thomas Henlich 2011-01-27 13:25:15 UTC --- (In reply to comment #3) > The copy of the F2008 standard I have says in 10.7.2.3.2 F editing: > > "When w is zero, the processor selects the field width." My interpretation is this: Section 10.7.2.1 (General rules) applies to these cases, which demands specifically: "... the processor selects the smallest positive actual field width that does not result in a field filled with asterisks. ..." The statement from 10.7.2.3.2 "When w is zero, the processor selects the field width." does only refer to this. IMHO it does not suggest the possibility to include optional characters (a leading decimal zero or plus sign) which make the field width larger than required. In the examples, since w=3 ("F3.2") does not result in a field filled with asterisks, and is the smallest possible such value, the processor must select a field width of 3. Also, it is inconsistent that the following commands should result in a different output: print "(F0.2)", 0.0 print "(F0.2)", tiny(0.0) 0.00 .00