(j3.2006) G editing to a narrow output field
Bill Long
longb
Thu Aug 18 10:52:22 EDT 2011
On 8/17/11 11:34 PM, Robert Corbett wrote:
> On 08/17/11 05:54, Bill Long wrote:
>>
>>
>> On 8/17/11 1:14 AM, Tobias Burnus wrote:
>>> Hi Bob,
>>>
>>> can you outline why you think that "** " is the correct output? For
>>> me, it seems that "******" is correct. We have (R1007) "G w [ . d [ E e
>>> ] ]" and in 10.7.2.1 one has:
>>>
>>> "(5) On output, if an exponent exceeds its specified or implied width
>>> using the E, EN, ES, D, or G edit descriptor, or the number of
>>> characters produced exceeds the field width, the processor shall fill
>>> the entire field of width w with asterisks. However, the processor shall
>>> not produce asterisks if the field width is not exceeded when optional
>>> characters are omitted."
>>
>> The key point here, which does not show up in email font, is that, in
>> the standard, the "w" in the phrase "entire field of width w" is in
>> syntax font. For G format, this ties to the line of R1007 noted
>> above. The value of w is clearly 6 here. That's what appears in the
>> program.
>>
>> Of the 5 compilers we support, 4 produced ****** and 1 produced ** .
>>
> I do not think this interpretation holds up to a strict reading of
> part of the standard you cited. The number of characters
> produced by an F2,4,4(' ') edit descriptor is six. Six does not
> exceed the field width of a G6,4 edit descriptor.
>
That is one possible reading, though one not very popular.
> The game you propose to play with the letter w runs into a problem
> as soon as you reach the first sentence of clause 10.7.2.3.2. The
> letter w there looks the same as the one in clause clause 10.7.2.1.
>
I would contend that the text in the F section is not relevant.
The real question here is whether the rules originally posted by Tobias
from 10.7.2.1
(1) apply to the syntax of the G descriptor written in the program, or
(2) apply to the resulting edit descriptor (F, perhaps ) after the
conversion from G to the resulting edit descriptor is made.
My reading is that it is (1), since if it were (2) the "G" option would
have been excluded in 10.7.2.1.
Since there are inconsistent implementations, however lopsided, this
seems like an interp candidate.
Cheers,
Bill
--
Bill Long longb at cray.com
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101
More information about the J3
mailing list