public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/50105] [4.6/4.7 Regression] I/O with g6.5 - wrong number of "**" shown
Date: Fri, 19 Aug 2011 11:17:00 -0000 [thread overview]
Message-ID: <bug-50105-4-ANqtXla8nM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50105-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50105
--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-08-19 10:34:13 UTC ---
A simple (partial) revert of the patch of PR 47285
(http://gcc.gnu.org/ml/fortran/2011-01/msg00226.html) will lead to wrong
results as one does not honour the following.
write(*,'(G5.5E5)') -10000.
will then print "* " instead of the correct "*****" which is printed
currently. However, due to "w-(e+2) = 5-(5+2) > 0" [where the symbols are:
Gw.dEe], the whole field should be filled with asterisks, cf. below.
I think best is to do a full revert, replace the following hack in the patch
+ if (e > 4)\
+ e = 4;\
by a simply check for w-4 > 0 or w-(e+2) > 0 and - if failing - fill it with
"*" and return. Only when succeeding, move to the FMT_F. In the latter padding
section, one can then always pad with ' '. I have not yet checked whether the
+ nb = nb >= w ? 0 : nb;\
is then still required or not.
>From the F2008 standard:
"if an exponent exceeds its specified or implied width using the ... G edit
descriptor," [the field should be filled with "*"].
One has for "Gw.d" n = 4 and for "Gw.d.Ee" it is "n = e+2". The requirement is
"w-n > 0". In that case, one needs to fill the whole width w (of "Gw.d") with
asterisks.
If "w-n > 0", one has "F(w-n).(dd),n(' ')" with some "dd" depending on rounding
and magnitude of the value. In that case, only (w-n) is - if needed - filled
with asterisks.
(For the calculations, see 10.7.5.2.2 (below the first table); see also
10.7.2.1 in comment 1 with the interpretation in comment 7.)
next prev parent reply other threads:[~2011-08-19 10:34 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-17 6:22 [Bug libfortran/50105] New: Possibly: [4.3/4.4/4.5/4.6/4.7 " burnus at gcc dot gnu.org
2011-08-17 6:40 ` [Bug libfortran/50105] " burnus at gcc dot gnu.org
2011-08-17 7:34 ` burnus at gcc dot gnu.org
2011-08-17 7:53 ` thenlich at users dot sourceforge.net
2011-08-17 9:14 ` [Bug libfortran/50105] Possibly: [4.6/4.7 " burnus at gcc dot gnu.org
2011-08-17 13:27 ` burnus at gcc dot gnu.org
2011-08-18 8:59 ` [Bug libfortran/50105] Possibly: " burnus at gcc dot gnu.org
2011-08-19 6:54 ` [Bug libfortran/50105] [4.6/4.7 Regression] " burnus at gcc dot gnu.org
2011-08-19 11:17 ` burnus at gcc dot gnu.org [this message]
2011-08-19 18:17 ` burnus at gcc dot gnu.org
2011-08-22 6:07 ` jvdelisle at gcc dot gnu.org
2011-10-26 17:21 ` jakub at gcc dot gnu.org
2012-01-10 0:41 ` jvdelisle at gcc dot gnu.org
2012-01-10 8:46 ` burnus at gcc dot gnu.org
2012-01-10 19:33 ` jvdelisle at gcc dot gnu.org
2012-01-12 9:08 ` burnus at gcc dot gnu.org
2012-02-03 19:22 ` tkoenig at gcc dot gnu.org
2012-02-18 9:54 ` burnus at gcc dot gnu.org
2012-02-18 17:51 ` dominiq at lps dot ens.fr
2012-03-01 14:56 ` jakub at gcc dot gnu.org
2013-01-02 17:24 ` [Bug libfortran/50105] [4.6/4.7/4.8 " burnus at gcc dot gnu.org
2013-01-02 20:46 ` jvdelisle at gcc dot gnu.org
2013-01-02 21:40 ` anlauf at gmx dot de
2013-02-15 7:39 ` burnus at gcc dot gnu.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-50105-4-ANqtXla8nM@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).