XL Fortran for AIX 8.1
Language Reference
Editing is performed on fields. A
field is the part of a record that is read on input or written on output when
format control processes one of the data or character string edit
descriptors. The field width is the size of the field in
characters.
The I, F, E, EN, ES,
B, O, Z, D, G, and extended
precision Q edit descriptors are collectively called numeric edit
descriptors. They are used to format integer, real, and complex
data. The following general rules apply to these edit
descriptors:
- On input:
- Leading blanks are not significant. The interpretation of other
blanks is controlled by the BLANK= specifier in the OPEN statement and the BN and BZ
edit descriptors. A field of all blanks is considered to be
zero. Plus signs are optional, although they cannot be specified for
the B, O, and Z edit descriptors.
- In F, E, EN, ES, D,
G, and extended precision Q editing, a decimal point
appearing in the input field overrides the portion of an edit descriptor that
specifies the decimal point location. The field can have more digits
than can be represented internally.
- On output:
- Characters are right-justified inside the field. Leading blanks are
supplied if the editing process produces fewer characters than the field
width. If the number of characters is greater than the field width, or
if an exponent exceeds its specified length, the entire field is filled with
asterisks.
- A negative value is prefixed with a minus sign. By default, a
positive or zero value is unsigned; it can be prefixed with a plus sign,
as controlled by the S, SP, and SS edit
descriptors.
+---------------------------------Fortran 95---------------------------------+
- Depending on whether you specify the signedzero or
nosignedzero suboptions for the -qxlf90 compiler option the
following will result for the E, D, Q(Extended
Precision), F, EN, ES or G(General
Editing) edit descriptors:
- when the signedzero suboption is chosen, and the internal
value is negative or a negative zero on output, a minus sign always be written
out to the output field, even if the output value is zero. The Fortran
95 standard requires this behavior.
+-------------------------------IBM Extension--------------------------------+
Note that in XL Fortran, a REAL(16) internal value of zero
is never treated as a negative zero.
+----------------------------End of IBM Extension----------------------------+
- when the nosignedzero suboption is chosen, and the output
value is zero, no minus sign will be written out to the output field, even if
the internal value was negative. The Fortran 90 standard requires this
behavior, and is consistent with the behavior of XL Fortran Version
5.1.1.
+----------------------------End of IBM Extension----------------------------+
+-------------------------------IBM Extension--------------------------------+
- In XL Fortran, a NaN (not a number) is indicated by
"NaNQ", "+NaNQ", "-NaNQ",
"NaNS", "+NaNS", or
"-NaNS". Infinity is indicated by
"INF", "+INF", or
"-INF".
+----------------------------End of IBM Extension----------------------------+
Notes:
- The ES and EN edit descriptors will behave the same for
both the signedzero and nosignedzero suboptions when the
internal value is non-zero. That is, the minus sign will be printed out
whenever the value is negative.
- In the examples of edit descriptors, a lowercase b in the
Output column indicates that a blank appears at that
position.
A complex value is a pair of separate real components.
Therefore, complex editing is specified by a pair of edit descriptors.
The first one edits the real part of the number, and the second one edits the
imaginary part of the number. The two edit descriptors can be the same
or different. One or more control edit descriptors can be placed
between them, but not data edit descriptors.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]