https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90374

--- Comment #24 from Thomas Henlich <thenlich+gccbug at gmail dot com> ---
There is another issue with E0.d editing, concerning the case |exp| ≥ 1000 with
extended and quad precision.

In addition to tables 13.1 ... 13.3, the standard says:

----
13.7.2 Numeric editing
13.7.2.1 General rules
...
(5) On output, if an exponent exceeds its specified or implied width using the
E, EN, ES, EX, 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.

(6) On output, with I, B, O, Z, D, E, EN, ES, EX, F, and G editing, the
specified value of the field width w may be zero. In such cases, the processor
selects the smallest positive actual field width that does not result in a
field filled with asterisks. The specified value of w shall not be zero on
input.
----

Example:

Should the following code
write(*, "(e0.10)")  1e1234_10
result in 

a) a field filled with asterisks because 13.7.2.1(5) applies, and if so, how
many?

b) the same output as E0.10E4 editing ("0.1000000000E+1234") because
13.7.2.1(6) applies

In my opinion, it should be a), with a field width corresponding to the width
of the field corresponding to the smallest width required for the mantissa plus
4 for the implied exponent width.

Reply via email to