public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "thenlich at users dot sourceforge.net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/47434] New: Wrong field width for NaN with (F0.n) formatting
Date: Mon, 24 Jan 2011 13:19:00 -0000	[thread overview]
Message-ID: <bug-47434-4@http.gcc.gnu.org/bugzilla/> (raw)

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 "<blank>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:
<blank>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.


             reply	other threads:[~2011-01-24 12:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24 13:19 thenlich at users dot sourceforge.net [this message]
2011-01-24 13:26 ` [Bug libfortran/47434] " jvdelisle at gcc dot gnu.org
2011-01-24 14:49 ` thenlich at users dot sourceforge.net
2011-01-27 13:23 ` jvdelisle at gcc dot gnu.org
2011-01-27 13:30 ` burnus at gcc dot gnu.org
2011-01-27 14:01 ` thenlich at users dot sourceforge.net
2011-01-27 14:03 ` burnus at gcc dot gnu.org
2011-01-27 16:51 ` jvdelisle at gcc dot gnu.org
2011-01-27 17:29 ` burnus at gcc dot gnu.org
2011-01-27 18:31 ` thenlich at users dot sourceforge.net
2011-01-29 17:37 ` jvdelisle at gcc dot gnu.org
2011-01-29 17:40 ` jvdelisle at gcc dot gnu.org
2011-01-29 19:29 ` jvdelisle at gcc dot gnu.org
2011-02-02 18:15 ` dnovillo at gcc dot gnu.org
2011-02-02 18:16 ` dnovillo 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-47434-4@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).