(j3.2006) G editing to a narrow output field

Bill Long longb
Fri Aug 19 12:25:31 EDT 2011



On 8/18/11 8:33 PM, Malcolm Cohen wrote:
>> 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.
>
> Yes, but that quoted text
>     ***DOES NOT APPLY***
>
> The wording is quite tricky, you need to read it very carefully.
>
> It says (slight restructuring to make it clearer)
>    "On output,
>      (a) if an exponent exceeds its specified or implied width using the ... G
> edit descriptor,
> or
>      (b) the number of characters produced exceeds the field width,
>      [you get stars]"
>
> The bit that explicitly mentions G ***only applies to the exponent width being
> exceeded***.
>
Yes, I got that distinction. That is why I was careful to say "would he 
been excluded" above.  If there is no qualifying list of edit 
descriptors, I assume the statements in 10.7.2.1 apply  to all of the 
descriptors listed at the beginning of the section, including G.  If (b) 
does not apply to G, then we need to explicitly say that, though I think 
that change is a mistake and not what is intended.

> That is not the case here.
>
> What about the number of characters produced?  Well, as Robert says, the F2.5
> descriptor produces two characters (both stars) and the 4(' ') produces another
> 4, making a total of 6, within the width of G6.5.
>

Most users understand the words in (b) to mean that you get stars 
printed if the value cannot be represented by the given format because w 
is too small.  Perhaps is needs to be worded better.

The underlying question is whether the field width meant there is the 
one explicitly visible in the G6.5 (i.e.6), or the field width of the 
ultimate F descriptor, 2.    Most implementations have interpreted the 
right answer to be 6 stars.   From the user's point of view, that is by 
far the more useful output since the ****** matches the size of the 
field seen in the code.  If we say the right output is **    then the 
user needs to dig into the obscure rules about how G gets transformed 
into other descriptors (without being able to see the actual value 
involved!!) and the subsequent rules for those descriptors.  For people 
like Bob those rules are "obvious", but expecting the normal user to 
figure all that out is substantially unhelpful.

> Perhaps this is merely bad wording, but it goes back a long way (F77).
>
>> Since there are inconsistent implementations, however lopsided, this seems like
>> an interp candidate.
>
> I don't disagree with that.  Let's make another inconsistency with
> F77/90/95/2003!?
>

I would see an interp answer of ***** as being consistent with all the 
past standards, and a helpful clarification.

Cheers,
Bill



> Cheers,

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