HP Fortran Programmer's Reference (September 2007)

I/O formatting
Edit descriptors
Chapter 9250
•AnE followed by an optionally signed integer constant
•AD followed by an optionally signed integer constant
•AQ followed by an optionally signed integer constant
All four exponent forms are processed in the same way. Note, however, that
e
has no effect on
input.
The EN and ES edit descriptors are the same as the F edit descriptor on input. The Q edit
descriptor (an HP Fortran extension) is the same as the E edit descriptor on input.
Table 9-10 provides examples of the real edit descriptors on input. The BZ edit descriptor
listed in the “Descriptor” column treats nonleading blanks in numeric fields as zeroes.
Real edit descriptors on output
The output field for the real descriptors consists of
w
character positions, filled with leading
blanks (if necessary) and an optionally signed real constant with a decimal point, rounded to
d
digits after the decimal point. The following sections describe the real edit descriptors on
output in detail.
D and E edit descriptors The D and E edit descriptors define a normalized floating-point
field for real and complex values. The value is rounded to
d
digits. The exponent part consists
of
e
digits. If E
e
is omitted in a D or E edit descriptor, then the exponent occupies two or three
positions, depending on its magnitude. The field width,
w
, should follow the general rule:
w
is
greater than or equal to
d
+7. If E
e
is used,
w
is greater than or equal to
d
+
e
+5. This rule
provides positions for a leading blank, the sign of the value, the decimal point,
d
digits, the
exponent letter (D, E, or Q), the sign of the exponent, and the exponent. The E
e
, D
e
, and Q
e
specifications, which are available with the E edit descriptor, control which exponent letter is
output.
Table 9-10 D, E, F, and G edit descriptors: input examples
Descriptor Input field Value stored
F6.5 4.51E4 45100
G4.2 51-3 .00051
E8.3 7.1
b
E
b
5 710000
D9.4
bbb
45E+35
.0045 x 10
35
BZ, F6.1 -54E3
b
-5.4 x 10
30