To: J3 J3/14-176r2
From: David Muxworthy
Subject: UK proposal UK-14 Minimal exponent width
Date: 2014 June 24
Status: For Consideration
Basic Functionality: Minor FORMAT extension
Comment: This is item 2.1 and part of 2.3 of section UK-04 of N1975.
Rationale:
Allow a more robust, and usually more compact, form for the printing
of numbers in scientific notation, particularly for values with large
exponents. A deficiency of the Ew.d descriptor is that the +/-0nn and
+/-nnn output forms for exponents can cause silently wrong effects
when fed to almost any other language or application. Further Ew.d as
currently defined cannot cope with exponents greater than 999 (these
can appear e.g. for IEEE 128-bit floating-point numbers).
If Ew.dEe is used to force the printing of the exponent letter (E) and
to avoid possible exponent overflow, wide variations in values can
lead to an unnecessary number of leading zeros in the exponents.
Specification:
For output using E, EN, ES, or G edit descriptors, add a means to
request "minimal exponent width". This will display the whole
exponent value without leading zeros (and display a single 0 digit for
zero exponent).
Syntax:
Permit the "e" in the "Ee" part of the E, EN, ES, and G edit
descriptors to have the value zero. E0 requests the exponent width to
be minimal.
Edits to J3/14-007r1(= N2014):
[xviii] Add to bullet Input/Output: "In a \si(data edit descriptor),
the exponent width \si(e) may be zero."
[247:19] Delete constraint C1006.
[253:14] In 10.7.2.3.3 E and D editing, para. 1,
Replace ", and the exponent part consists of digits." by
". If is positive the exponent part consists of digits,
otherwise it consists of the minimum number of digits required to
represent the exponent value."
[253:25+6] In 10.7.2.3.3 E and D editing, Table 10.1, line 3,
After "E\si{w}.\si{d}E\si{e}"
insert "with $\si{e} > 0$",
and insert a new line after it
"E\si{w}.\si{d}E0 & any & E+-z_1 z_2 ... z_s (2) \\"
and add a second footnote within the table
"(2) where ~~ is the minimum number of digits required to
represent the value".
[254:7] In 10.7.2.3.4 EN editing, para. 2,
Replace "and the exponent part consists of digits." by
". If is positive the exponent part consists of digits,
otherwise it consists of the minimum number of digits required to
represent the exponent value."
{Same edit as for [253:14].}
[254:19+6] In 10.7.2.3.4 EN editing, Table 10.2,
After "EN\si{w}.\si{d}E\si{e}"
insert "with $\si{e} > 0$",
and insert a new line after it
"EN\si{w}.\si{d}E0 & any & E+-z_1 z_2 ... z_s (2) \\"
and add a second footnote within the table
"(2) where ~~~~ is the minimum number of digits required to represent
the value".
{Similar to the edit for [253:25+6].}
[254:27] In 10.7.2.3.5 ES editing, para. 2,
Replace "and the exponent part consists of digits." by
". If is positive the exponent part consists of digits,
otherwise it consists of the minimum number of digits required to
represent the exponent value."
{Same edit as for [253:14].}
[255:10+6] In 10.7.2.3.5 ES editing, Table 10.3,
After "ES\si{w}.\si{d}E\si{e}"
insert "with $\si{e} > 0$",
and insert a new line after it
"ES\si{w}.\si{d}E0 & any & E+-z_1 z_2 ... z_s (2) \\"
and add a second footnote within the table
"(2) where ~~~~ is the minimum number of digits required to represent
the value".
{Similar to the edit for [253:25+6].}
[258:24] In 10.7.5.2.2 Generalized real and complex editing, para. 5,
Before "\si{e} + 2"
change "and" to ",",
after "+ 2 for G\si{w}.\si{d}E\si{e} editing"
insert
"if $\si{e} > 0$, and 4 for G\si{w}.\si{d}E0 editing".
{For exponent values in the range 10-99, this produces the same output
as for Gw.d and Gw.dE2. Exponents in the range 0-9 are most likely to
result in F format output so their exponent widths are less important.}
~~