Intel® Fortran Compiler 17.0 Developer Guide and Reference

F Editing

The F data edit descriptor transfers real values. It takes the following form:

Fw.d

The value of d (the number of places after the decimal point) must not exceed the value of w (the field width) unless w is zero. When w is zero, the processor selects the field width. On input, w must not be zero.

The specified I/O list item must be of type real, or it must be the real or imaginary part of a complex type.

Rules for Input Processing

On input, the F data edit descriptor transfers w characters from an external field and assigns their real value to the corresponding I/O list item. The external field data must be an integer or real constant.

An input field is one of the following:

The basic form can be followed by an exponent in one of the following forms:

An exponent containing a D is processed in the same way as an exponent containing an E.

If the input field contains only an exponent letter or decimal point, it is treated as a zero value.

If the input field does not contain a decimal point or an exponent, it is treated as a real number of w digits, with d digits to the right of the decimal point. (Leading zeros are added, if necessary.)

If the input field contains a decimal point, the location of that decimal point overrides the location specified by the F descriptor.

If the field contains an exponent, that exponent is used to establish the magnitude of the value before it is assigned to the list element.

An input field that is an IEEE exception specification consists of optional blanks, followed by either of the following:

The NaN value is a quiet NaN if the only nonblank characters in the field are 'NAN' or 'NAN()'.

The following shows input using the F edit descriptor:

Format    Input         Value
F8.5      123456789       123.45678
F8.5      -1234.567     -1234.56
F8.5      24.77E+2       2477.0
F5.2      1234567.89      123.45

Rules for Output Processing

On output, the F data edit descriptor transfers the real value of the corresponding I/O list item, right-justified and rounded to d decimal positions, to an external field that is w characters long.

For an internal value that is an IEEE infinity, the output field consists of blanks, if needed, followed by a sign (optional if the value is positive and descriptor SP is not in effect), followed by the letters 'Inf' or 'Infinity', right justified within the field.

If w is less than 3, the field is filled with asterisks; otherwise, if w is less than 8, 'Inf' is produced.

For an internal value that is an IEEE NaN, the output field consists of blanks, if necessary, followed by the letters 'NaN' and optionally followed by one to w − 5 alphanumeric characters enclosed in parentheses, right justified within the field.

If w is less than 3, the field is filled with asterisks.

For an internal value that is neither an IEEE infinity nor an IEEE NaN, the w must be greater than or equal to d+3 to allow for the following:

A negative value that is not zero but rounds to zero on output is displayed with a leading minus sign. For example, the value -0.00000001 in F5.1 format will be displayed as -0.0 rather than as 0.0. The setting of compiler option assume [no]std_minus0_rounding can affect this behavior.

The following shows output using the F edit descriptor (the symbol ^ represents a nonprinting blank character):

Format      Value             Output
F8.5           2.3547188      ^2.35472
F9.3        8789.7361         ^8789.736
F2.1          51.44           **
F10.4        -23.24352        ^^-23.2435
F5.2         325.013          ******
F5.2           -.2            -0.20

See Also