# (j3.2006) Interp F08/0055: G editing for reals

Thomas Henlich thenlich
Wed Jul 6 16:05:19 EDT 2011

```As I read it, we have now replaced 10.7.5.2.2 paragraph 4 by

"If d is zero, kPEw.0 or kPEw.0Ee editing is used for Gw.0 editing or
Gw.0Ee editing respectively.

Otherwise, the method of representation in the output field depends on
the magnitude of the internal value being edited. Let N be the decimal
value resulting from the conversion of the internal value to decimal
and its subsequent rounding to d significant digits according to the
I/O rounding mode, and let s be the decimal exponent value of N, or 1
if N is equal to zero. If 0<=s<=d, F(w-n).(d-s),n('b') editing is used
where b is a blank and n is 4 for Gw.d editing and e+2 for Gw.dEe
editing.  If s<0 or s>d, kPEw.d or kPEw.dEe editing is used for Gw.d
editing or Gw.dEe editing respectively."

I see three issues:

1. "let s be the decimal exponent value of N" does not actually
specify that the significand should be normalized to the range [0, 1)
(as for 0PEw.d editing): 12.3E+00 and 1.23E+01 and 0.123E+02 all are
rounded to 2 significant digits but have different exponent values.

2. "let s be ... 1 if N is equal to zero." is not a good choice for two reasons:
- the wording is overly complicated, because something like "use
F(w-n).(d-1),n('b') editing if N is equal to zero" is much clearer to
read (we handle the case d=0 with the inserted paragraph).
- This case should only apply to "the internal value is zero", not "N
(the rounded value) is zero". There is a chance that a (non-standard)
processor-defined rounding mode rounds small non-zero values to zero,
so the two are not equivalent.

3. Is it intended that (RC,1P,G11.1) editing applied to 0.096 should
output "0.1" when (1P,E11.1) editing would output "9.6E-02" which does
not fall into the F editing range and represents the result with a
higher precision than the first?

```