[patch, fortran] PR38398 g0.w edit descriptor: Update for F2008 Tokyo meeting changes

Tobias Burnus burnus@net-b.de
Sun Dec 14 21:55:00 GMT 2008


Jerry,

thanks for the update, but I think the output is unfortunately not yet
is standard conform. Compare the output of g<w> for w = 0 and w != 0:

PRINT '(g10.5)', 1d1
PRINT '(g10.5)', 1d100
PRINT '(g0.5)', 1d1
PRINT '(g0.5)', 1d100
end

The output is:

10.000
.10000+101
10.00000
10000000000000000159029000000000000000000000000000000000000000000000000000000000000000000000000000000.00000

I would expect for the last line some "E" ouput.

http://www.j3-fortran.org/doc/year/08/08-296r2.txt
writes about this:

In 10.7.5.2.2, replace paragraph 2 with:
"When used to specify the output of real or complex data that is not an
 IEEE infinity or NaN, the G0 and G0.<d> edit descriptors follow the rules
 for the G<w>.<d>E<e> edit descriptor, except that any leading or trailing
 blanks are removed. Reasonable processor-dependent values of <w>, <d> 
 (if not specified), and <e> are used with each output value."

Don't confuse this with the next item:

[254:3] In 10.7.5.2.2 paragraph 3, insert after "Fw.d" the following, 
", and the form of the output field for the G0 and G0.d edit descriptors 
 is the same as for F0.0."

That only relates to NaN and +/-INF as paragraph 3 reads:

"For an internal value that is an IEEE infinity or NaN, the form
 of the output field for the Gw.d and Gw.d Ee edit descriptors is
 the same as for Fw.d."

Otherwise the patch is OK.

Tobias



More information about the Gcc-patches mailing list