Special Values

This topic lists the special values of IEEE floating-point REALs that the Intel® Compiler supports and provides a brief description of each of them.

Signed Zero

Intel Fortran treats zero as signed by default. The sign of zero is the same as the sign of a nonzero number. If you use the intrinsic function SIGN with zero as the second argument, the sign of the zero will be transferred. Comparisons, however, consider +0 to be equal to -0.

A signed zero is useful in certain numerical analysis algorithms but in most applications the sign of zero is invisible. -0.0 is accepted as formatted input but is printed as formatted output only when the -assume minus0 compiler option is used.

Denormalized Numbers

Denormalized numbers (denormals) fill the gap between the smallest positive normalized number and the smallest negative number. Otherwise only (+/-) 0 occurs in that interval. Denormalized numbers extend the range of computable results by allowing for gradual underflow.

Systems based on the IA-32 architecture support the Denormal Operand status flag, which when set, means that at least one of the input operands to a floating-point operation is a denormal. The Underflow status flag is set when a number loses precision and becomes a denormal.

Denormalized values can be read and printed with formatted I/O.

Signed Infinity

Infinities are the result of arithmetic in the limiting case of operands with arbitrarily large magnitude. They provide a way to continue when an overflow occurs. The sign of an infinity is simply the sign you obtain for a finite number in the same operation as the finite number approaches an infinite value.

By retrieving the status flags, you can differentiate between an infinity that results from an overflow and one that results from division by zero. Intel® Compiler treats infinity as signed by default. +Infinity and -Infinity are accepted as formatted input and those strings are printed on/as? formatted output.

Not a Number

Not a Number (NaN) results from an invalid operation. For instance 0/0 and SQRT(-1) result in NaN. In general, an operation involving a NaN produces another NaN. Because the fraction of a NaN is unspecified, there are many possible NaNs. The Intel® processor treats all NaNs identically but provides two different types of NaNs:

The floating-point hardware changes a signaling NAN into a quiet NAN during many arithmetic operations, including the assignment operation. An invalid exception may be raised but the resulting floating-point value will be a quiet NAN. An operation may raise an invalid exception and return a signaling NaN but if the exception is not trapped, the signaling NaN may be turned into a quite NaN by subsequent processing.

Fortran binary and unformatted input and output do not change the internal representations of the values as they are handled. Therefore, signaling and quiet NANs may be read into real data and output to files in binary form. 'NaN' is accepted as formatted input and results in a quiet NaN. 'NaN' is printed by formatted output for both signaling and quiet NaNs.