Special cases of the exponent-significand combination represent four types of special values in addition to the normalized numbers. The following table shows all five types of values.
IEEE Floating-Point Values
Name | Quantity | Exponent | Significand |
---|---|---|---|
Signed zero | ± 0 | E = Emin - 1 | sig = 0 |
Denormalized number | ± 0 . sig x 2Emin | E = Emin - 1 | sig not equal 0 |
Normalized number | ± 1 . sig x 2E | Emin<= E<= E max | sig |
Signed infinity | ± infinity | E = Emax + 1 | sig = 0 |
Not a Number | NaN | E = Emax + 1 | sig not equal 0 |
These special values are interpreted as follows:
Visual 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.
Denormalized numbers (denormals) fill the gap between the smallest positive number and the smallest negative number. Otherwise only (±) 0 occurs in that interval. Denormalized numbers permit gradual underflow for intermediate results calculated internally in extended-double format. A status flag (on ia32 systems, the precision bit in the FPU Status Word exception field) is set when a number loses precision due to denormalization.
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 described
in Setting
and Retrieving Floating-Point Status and Control Words in this section,
you can differentiate between an infinity that results from an overflow
and one that results from division by zero. Visual Fortran treats infinity
as signed by default. The output value of infinity is Infinity
or
-Infinity
.
Not a Number (NaN) results from an operation involving one or more invalid operands. 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. Visual Fortran treats all NaNs identically, but provide two different types:
The output value of NaN is NaN
.