From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20775 invoked by alias); 27 Jan 2011 17:21:57 -0000 Received: (qmail 20761 invoked by uid 22791); 27 Jan 2011 17:21:55 -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 17:21:50 +0000 From: "burnus at gcc dot gnu.org" 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: burnus at gcc dot gnu.org 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 17:29: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/msg03017.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47434 --- Comment #8 from Tobias Burnus 2011-01-27 17:21:24 UTC --- (In reply to comment #7) > I remember the discussion when we first implemented this and we wanted the + on > Inf to be consistent with -Inf. Well, the following is in any case wrong: real :: inf inf = 0 inf = 1/inf print "(sp,F0.2)", inf ! SIGN=PLUS print "(ss,F0.2)", inf ! SIGN=SUPPRESS print "(s, F0.2)", inf ! SIGN=PROCESSOR_DEFINED end The same result for "F4.2": Three times "+Inf". (Ditto for g95.) For SIGN=SUPPRESS it should just print "Inf", whether "Inf" or "+Inf" is correct for PROCESSOR_DEFINED is another question. For consistency with the other compilers - and for consistency with 10.7.2.1(6), one should probably remove the "+". For "F4.2" also the other compilers do not seem to print a + with sign='PROCESSOR_DEFINED' though I am not sure that I like Intel's/pathscale's/open64's "Infi" for S and SS better. NAG and Sunf95 have " Inf" for S/SS. Regarding "0.00" vs ".00" with "F0.2": I do not have any real preference; following 10.7.2.1(6) I am slightly inclined that ".00" is better.