Extended-precision values
Open XL Fortran extended precision is not in the binary128 format suggested by the IEEE standard. The IEEE standard suggests extended formats use more bits in the exponent for greater range and the fraction for greater precision.
Open XL Fortran extended precision, equivalent to REAL(16) in Fortran programs, is implemented in software. Extended precision provides the same range as double precision (about 10**(-308) to 10**308) but more precision (a variable amount, about 31 decimal digits or more). The software support is restricted to round-to-nearest mode. Programs that use extended precision must ensure that this rounding mode is in effect when extended-precision calculations are performed. For the different ways you can control the rounding mode, see Selecting the rounding mode.
- Extended-precision numbers are composed of two double-precision numbers with different magnitudes that do not overlap (except when the number is zero or close to zero). That is, the binary exponents differ by at least the number of fraction bits in a REAL(8). The high-order double-precision value (the one that comes first in storage) must have the larger magnitude. The value of the extended-precision number is the sum of the two double-precision values.
- For a value of NaN or infinity, you must encode one of these values within the high-order double-precision value. The low-order value is not significant except that it cannot be set to NaN when the high-order value is infinity.
- In the discussions of rounding errors because of compile-time folding of expressions, keep in mind that this folding produces different results for extended-precision values more often than for other precisions.
- Special numbers, such as NaN, infinity, and negative zero, are not fully supported by the extended-precision values. Arithmetic operations do not necessarily propagate these numbers in extended precision.
- Open XL Fortran does not always detect floating-point exception conditions (see Detecting and trapping floating-point exceptions) for extended-precision values. If you turn on floating-point exception trapping in programs that use extended precision, Open XL Fortran may also generate signals in cases where an exception condition does not really occur.
- The exact representation is sometimes different between AIX® and Linux®.
- Not all math library functions are available for extended precision.