[patch, libfortran] PR39402 write of 0.0 with F0.3 gives **

Steve Kargl sgk@troutmask.apl.washington.edu
Mon Mar 9 05:18:00 GMT 2009


On Sun, Mar 08, 2009 at 10:00:57PM -0700, Jerry DeLisle wrote:
> The following patch was committed after regression testing and NIST 
> testing.  It is a limited special case, simple, and obvious. New test 
> case also provided.
> 

The previous behavior was arguably correct according to the standard.

    The Fw.d edit descriptor indicates that the field occupies w
    positions, the fractional part of which consists of d digits.
    When w is zero, the processor selects the field width.

For F0.3, the processor can select w = 2, and therefore .000 (ie.,
the d=3 case) won't fit into a width of 2.  While your fix is
OK, I do not think that it is obvious.

-- 
Steve



More information about the Gcc-patches mailing list