From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5339 invoked by alias); 10 Apr 2011 10:20:09 -0000 Received: (qmail 5325 invoked by uid 22791); 10 Apr 2011 10:20:09 -0000 X-SWARE-Spam-Status: No, hits=-2.8 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; Sun, 10 Apr 2011 10:20:04 +0000 From: "thenlich at users dot sourceforge.net" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/48511] Implement Steele-White algorithm for numeric output 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: enhancement X-Bugzilla-Who: thenlich at users dot sourceforge.net X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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: Sun, 10 Apr 2011 10:20: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/msg00991.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48511 --- Comment #5 from Thomas Henlich 2011-04-10 10:19:47 UTC --- (In reply to comment #4) > (In reply to comment #3) > > Does any of the Fortran edit descriptors require, or for that matter allow, > > this kind of "shortest decimal representation" output? > > Well, the obvious(?) answer is the various descriptors with 0 width. Not quite: Since we're not talking about the shortest width (w) but the smallest number of decimal digits in the fraction (d), only those descriptors where we can select "a processor-dependent reasonable value for d" can be "shortened": That would be list-directed and G0 (but not G0.d). For all others the algorithm is still useful if we append zeros to fill the required width: it is better to print 0.3000000 than 0.2999996 I'm still not sure where the Fortran standard says "a processor-dependent reasonable value for d" that includes a "processor-dependent reasonable value for d which also depends on the internal value to be printed" because that would mess up tabular aligment for printing. This might be a feature users rely on.