HP Fortran Programmer's Reference (September 2007)

I/O formatting
Edit descriptors
Chapter 9 253
The magnitude is less than 0.1 but not zero.
The magnitude is greater than or equal to 10**
d
(after rounding to
d
digits).
If the magnitude does not fit either of these rules, the F edit descriptor is used. When F is
used, the field width is reduced by either 4 when Gw.d is specified, or by e+2 when Gw.dEe is
specified. It is then followed by a number of trailing spaces equal to the number that the field
width was reduced by. Finally, d is modified internally according to the new field width.
For fixed- or floating-point format descriptors, the field width is
w
. The value is rounded to
d
digits, and the exponent consists of
e
digits. If E
e
is omitted, the exponent occupies two
positions. If E
e
is omitted and the exponent is greater than 99 (that is, it requires three
digits), the exponent letter is dropped from the output. The field width,
w
, should follow the
general rule:
w
is greater than or equal to the sum of
d
+7; or, if E
e
is specified,
w
is greater
than or equal to the sum of
d
+
e
+5. This rule provides positions for a leading blank, the sign of
the value,
d
digits, the decimal point, and, if needed, the exponent letter (D, E,orQ), the sign of
the exponent, and the exponent. Note that the E
e
, D
e
, and Q
e
specifications control which
exponent letter is output.
Table 9-14 provides examples of the G edit descriptor on output.
Table 9-14 G edit descriptor: output examples
Descriptor Internal value Interpretation Output
G10.3 +1234.0 E10.3
b
0.123E+04
G10.3 -1234.0 E10.3 -0.123E+04
G12.4 +12345.0 E12.4
bb
0.1235E+05
G12.4 +9999.0 F8.0, 4X
bbb
9999.
bbbb
G12.4 -999.0 F8.1, 4X
bb
-999.0
bbbb
G7.1 +.09 E7.1 0.9E-01
G5.1 -.09 E5.1 *****
G11.1 +9999.0 E11.1
bbbb
0.1E+05
G8.2 +9999.0 E8.2 0.10E+05
G7.2 -999.0 E7.2 *******
G8.2 .true L8
bbbbbbbT
G7.2 -999.0 E7.2
bbbb
1234