An external floating-point (EFP) data item is defined by a picture that strongly resembles a floating-point numeric literal:
{+} mantissa E {+} 99 {-} {-}
The mantissa is a string containing:
The exponent is always exactly two digits long, so the last two characters of the picture must be "99".
A plus sign "+" in the picture indicates that a nonnegative mantissa or exponent will be preceded by a plus sign; a minus sign "-" indicates that a nonnegative mantissa or exponent will be preceded by a space.
A negative mantissa or exponent is always preceded by a minus sign.
When a numeric value is converted to EFP format, the result is normalized so that the leftmost digit of the mantissa is nonzero, if this can be done without reducing the exponent below "-99". Zero is represented by a mantissa and exponent consisting entirely of zeros.
When exponent overflow occurs, the mantissa of the result consists entirely of "9"s, and its exponent is "+99".
When exponent underflow occurs, the result is not normalized, and may be zero if it is too small to be represented in this format.
Examples:
picture | value | data | notes |
---|---|---|---|
+9.999E+99 | 123 | +1.230E+02 | |
+9.999E+99 | 123.0E99 | +9.999E+99 | exponent overflow |
-9V999E+99 | 123 | 1230E+02 | |
-9V999E-99 | 123 | 1230E 02 | |
+V9999E-99 | 0.0123 | +1230E-01 | note normalization |
+V9999E-99 | 0.01E-99 | +0100E-99 | exponent underflow |
-99999.E+99 | 123 | 12300.E-02 |