HP Fortran Programmer's Reference (September 2007)

I/O formatting
Edit descriptors
Chapter 9252
F edit descriptor
The F edit descriptor defines a field for real and complex values. The value is rounded to
d
digits to the right of the decimal point. The field width,
w
, should be four greater than the
expected length of the number to provide positions for a leading blank, the sign, the decimal
point, and a roll-over digit for rounding if needed.
Table 9-13 provides examples of the F edit descriptor on output.
G edit descriptor
The G edit descriptor can be used with any data type but is commonly used to define a field for
real and complex values.
When used to specify I/O fields for integer, character, and logical data, the G edit descriptor
has the same syntax and same effect as the integer, character, and logical edit descriptors.
The
d
and
e
values (if specified) have no effect.
According to the magnitude of the data, the G edit descriptor is interpreted as either an E or F
descriptor. (For more information on these edit descriptors, refer to “D and E edit descriptors”
on page 250 and “F edit descriptor” on page 252.) The E edit descriptor is used when one of the
following conditions is true:
ES12.3 +1234.5
bbb
1.235E+03
Table 9-13 F edit descriptor: output examples
Descriptor Internal value Output
F5.2 +10.567 10.57
F3.1 -254.2 ***
F6.3 +5.66791432
b
5.668
F8.2 +999.997
b
1000.00
F8.2 -999.998 -1000.00
F7.2 -999.997 *******
F4.1 +23 23.0
Table 9-12 EN and ES edit descriptors: output examples (Continued)
Descriptor Internal value Output