On 12/25/17 6:34 PM, robin....@gmail.com
> If leading zeros in the exponent are eliminated, then
> the format is unultable for producing tables.
No, that would allow more significant digits to be written into the
specified width column fields. That would be the goal in this case, to
write the maximum number of significant digits into the fixed width
>> As I have explained several times in this thread already, the
>> descriptors that I am talking about would involve switching between F
>> and E formats in order to achieve their goals.
> Then the output will be unsuitable for producing a table.
Yes, a table with fixed column width fields can be written with the
appropriate mixtures of f and e descriptors. I would also want
unnecessary leading zeros to be eliminated from exponent fields, and at
least the option to eliminate any leading + signs.
> What you need is to write your own conversion.
I have already done this in specific situations. What I'm suggesting is
that this would be a popular output option if it were incorporated into
the language standard as standard field descriptors for everyone to use.
[...]>> Yes, the number of significant digits displayed does depend on
>> width, but the current E, F, and G formats do not result in either the
>> maximum digits within a field width
> They do, if you choose the approproate value for field width.
>> or in the minimum field width given
>> the specified number of significant digits.
> Try the 0.n specification for the relevant format feld descriptor.
Have you read any of the previous posts in this thread? I have already
shown examples of how this is inadequate for the two tasks with the
current field descriptors. Currently to achieve this goal, you could
determine the output field descriptor at runtime, write the data into a
character variable, and write out that character variable. I am
proposing that this effort be collapsed into a new pair of field
descriptors and made available as the current e, f, and g descriptors
>> No, but the other requirement does. Namely, given the specified field
>> width, find a format that results in the maximum number of significant
>> digits displayed.
> You can get that already by specifying the appropriate field width.
Well, duh, again. What I am proposing is that the compiler does that
work instead of the programmer. It is not a trivial task, and it needs
to be done in a robust way.
>> Of course the current formats can be used to produce
>> aligned tables, but those formats do not result in the maximum number of
>> digits displayed.
> They do if you choose the appropriate field width.
Well, duh, yet again.
>>> I think that you have not investigated what can be done with
>>> existing format field descriptors.
>> Then it should be easy to show how one of those existing format
>> descriptors satisfies either or both of the goals.
> I already did.
Still waiting on this one. If you think this already exists, then show
me examples of a field descriptors that satisfy each of the two types of
$.02 -Ron Shepard