REAL Type

12-1
The REAL type is used to contain floating point, or scientific notation, numbers in the range 10-70 to 1070.

External Form -- Input

Format allowed is as follows, such that either ( or both)
nnnnnn
and
mmmmmm
are present, and the resulting REAL number is within the allowable range:
+ or -
(optional, plus or minus sign, followed by)
nnnnnn
(optional, any number of digits, followed by)
.
(optional, decimal place, followed by)
mmmmmm
(optional, any number of digits, followed by)
E
sxx
(optional, signed exponent power of 10, range -99 to 99)
Examples:
14578923455096765442839404 -123.567 .555 .0023E-23 3.142776589E+66

External Form -- Output

The default is a normalized decimal real number:
+ or -
(plus or minus sign of the value, followed by)
.
(decimal place indicator, followed by)
nnnnnn
(15 significant fraction digits, followed by)
E
sxx
(signed exponent power of 10)
Examples:
+.314277658900000E-10 -.123456789000000E+52
A compiler directive is available to specify how a REAL type is to be presented externally. For example:
x REAL --< EF(3,5)>--
The above directive gives an external form for the number +.314277658900000E-10 as 3.14277.
This has three digits before the decimal point, (including two blanks) and five digits after the decimal point.
Space padding occurs on the left if required, and zero padding occurs on the right. No truncation takes place. The external form expands to allow all of the digits that precede the decimal point in a real number to be represented in full.

Local Form and Behavior

For IBM S/370 machines, local form is a 64-bit long floating point value, and the component must be at least 8 bytes in length. Truncation is not allowed. If the component has a fixed length greater than 8 bytes, the value is left aligned and padded on the right with zero bytes.

Named Values

Named values are not applicable to the EXTERNAL type.

Constraints

Real types can be restricted to a set of real value ranges or simple real values. For example:
REAL ({150, 10, -2}..{150, 10, -1})
The above example restricts the real type to the range (1.5...15). It is possible to specify a real range using whole numbers as well, for example:
REAL (1..20)