FORTRAN Reference Manual

Statements
FORTRAN Reference Manual528615-001
7-43
Editing Numeric Data
Editing Numeric Data
The edit descriptors:
B G
D I
E O
F Z
specify the external format of integer, real, double precision, and complex data.
The following general rules apply to numeric editing:
On input, leading blanks are not significant. The treatment of other blanks is
determined either by the BLANK= specifier in an OPEN statement or by any BN or
BZ specifiers for that unit. The formatter treats a field of all blanks as zero.
A decimal point in the input field overrides the decimal point specification of a
numeric field descriptor. The following example shows the editing performed for a
field described as E5.1:
On output, positive values are prefixed with a blank unless you use the SP edit
descriptor to specify that a plus sign is mandatory. Negative values are prefixed
with a minus sign.
The formatter right-justifies data in the output field for all output conversions. The
field width, w, must be large enough to accommodate all characters in the field
including, where appropriate, the sign for base and exponent, and decimal point for
base. If the number of characters produced by the conversion is less than the
specified field width, the formatter inserts leading blanks in the output field unless
you specify a minimum number of digits in which case leading zeros are produced
as necessary. If the number of characters produced by the conversion exceeds the
specified field width, the formatter writes asterisks throughout the field.
For the B, O, and Z edit descriptors, the data value is treated as unsigned,
regardless of its data type. The output data never includes a plus or minus sign.
Because complex data items must be represented by two floating-point quantities,
you must use two conversion elements in the format specification, one for the real
part and one for the imaginary part. In the following example the real part of A has
Input Stored Value
.5671 0.5671
56.71 56.71
5671 567.1