FORTRAN Reference Manual
Statements
FORTRAN Reference Manual—528615-001
7-50
Logical Editing
The P Descriptor
The P descriptor has the form
kP
where k is an integer constant called the scale factor. If you omit this specification,
FORTRAN assumes a default value of 0 for k.
The P descriptor affects the position of the decimal point on input or output. You can
use the P descriptor preceding D, E, F, and G format specifications or independently.
Once you specify a scale factor, it applies to all subsequent D, E, F, and G descriptors
in a FORMAT specification until it is overridden by another scale factor.
On input, for F, E, D, and G editing, the external number is divided by 10** k and
stored.
On output, for F editing, the external number is the internal number multiplied by 10**
k. When the number is output, the decimal point stays fixed and the number is
adjusted to the left or right depending on whether k is positive or negative.
For E and D editing, the kP specification shifts the output coefficient left k places and
reduces the exponent by k. The scale factor also controls decimal normalization
between the coefficient and the exponent such that if k is less than or equal to zero,
there will be exactly - k leading zeros and d+ k significant digits after the decimal point.
If k is greater than zero, there will be exactly k significant digits to the left of the
decimal point and d-1+ k significant digits to the right of the decimal point.
The scale factor does not affect G editing unless the magnitude of the number output
exceeds the range that permits use of the F conversion. In this case the scale factor
has the same effect as for E and D editing.
Logical Editing
The L w edit descriptor specifies that the external field occupies w positions. An I/O list
item matched with an L edit descriptor must be of logical type. On input, the list item
will become defined with a logical value; on output, the list item must have been
previously defined with a logical value.
123.45678900 123.456789 123.457
1234.56789000 1234.567890 1234.57
12345.67890000 12345.678900 12345.7
123456.78900000 123456.789000 123457.
1234567.89000000 ************* 0.123457E+07
Table 7-7. Comparison of F and G Editing (page2of2)
Value F13.6 Editing G13.6 Editing










