public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/47434] New: Wrong field width for NaN with (F0.n) formatting
@ 2011-01-24 13:19 thenlich at users dot sourceforge.net
  2011-01-24 13:26 ` [Bug libfortran/47434] " jvdelisle at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: thenlich at users dot sourceforge.net @ 2011-01-24 13:19 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2011-02-02 18:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-24 13:19 [Bug libfortran/47434] New: Wrong field width for NaN with (F0.n) formatting thenlich at users dot sourceforge.net
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

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).