The basic numeric formats are used for input and output of real numbers in standard or scientific notation. The following table shows an example of how each format displays positive and negative numbers with the default decimal point setting:
On output, numbers in F format are expressed in standard decimal notation with the requested number of decimal places. The other formats output some variation on this style:
On input, the basic numeric formats accept positive and numbers in standard decimal notation or scientific notation. Leading and trailing spaces are allowed. An empty or all-spaces field, or one that contains only a single period, is treated as the system missing value.
In scientific notation, the exponent may be introduced by a sign (‘+’ or ‘-’), or by one of the letters ‘e’ or ‘d’ (in uppercase or lowercase), or by a letter followed by a sign. A single space may follow the letter or the sign or both.
DATA LIST (see DATA LIST FIXED) and in a few
other contexts, decimals are implied when the field does not contain a
decimal point. In F6.5 format, for example, the field
taken as the value 3.14159 with implied decimals. Decimals are never
implied if an explicit decimal point is present or if scientific
notation is used.
E and F formats accept the basic syntax already described. The other formats allow some additional variations:
All of the basic number formats have a maximum field width of 40 and accept no more than 16 decimal places, on both input and output. Some additional restrictions apply:
More details of basic numeric output formatting are given below:
3in F1.0 format, and -1.125 as
-1.13in F5.1 format.
In scientific notation, the number always includes a decimal point, even if it is not followed by a digit.
-Infinityfor infinities, from
NaNfor “not a number,” or from
Unknownfor other values (if any are supported by the system). In fields under 3 columns wide, special values are output as asterisks.