This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libfortran/47434] Wrong field width for NaN with (F0.n) formatting


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47434

--- Comment #2 from Thomas Henlich <thenlich at users dot sourceforge.net> 2011-01-24 14:37:29 UTC ---
A similar issue occurs with the values +Infinity and 0.0:

program testnan
    real :: i, n = 0.0, m = tiny(0.0)
    i = 1.0 / n
    print "(F0.2)", i
    print "(F3.2)", i

    print "(F0.2)", n
    print "(F3.2)", n

    print "(F0.2)", m
    print "(F3.2)", m
end program testnan

Output:
+Inf
Inf
0.00
.00
.00
.00

The expected chosen field width is 3 in all cases, exactly for the same reason
demanded by 10.7.2.1(6)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]