Oracle® Solaris Studio 12.4: Numerical Computation Guide

Exit Print View

Updated: January 2015
 
 

4.2.1 Notes for Table 4-1

  1. Unordered comparison: Any pair of floating-point values can be compared, even if they are not of the same format. Four mutually exclusive relations are possible: less than, greater than, equal, or unordered. Unordered means that at least one of the operands is a NaN (not a number).

    Every NaN compares “unordered” with everything, including itself. The following table shows which predicates cause the invalid operation exception when the relation is unordered.

    Math Predicate
    C, C++ Predicate
    Fortran Predicate
    Invalid Expression (If Unordered)
    =
    ==
    .EQ.
    no
    !=
    .NE.
    no
    >
    >
    .GT.
    yes
    >=
    .GE.
    yes
    <
    <
    .LT.
    yes
    <=
    .LE.
    yes
  2. Invalid conversion: Attempt to convert NaN or infinity to an integer, or integer overflow on conversion from floatin g-point format.

  3. The smallest normal numbers representable in the IEEE single, double, and extended formats are 2-126, 2-1022, and 2-16382, respectively. See Chapter 2, IEEE Arithmetic for a description of the IEEE floating-point formats.

  4. The following table lists the default result when the trap is disabled for overflow. The below results depend on the rounding mode and the sign of the intermediate result.

    Rounding Mode
    Positive
    Negative
    Nearest
    +∞
    -∞
    Zero
    +∞
    -max
    Down
    +max
    -∞
    Up
    +∞
    -max

The x86 floating-point environment provides another exception not mentioned in the IEEE standards: the denormal operand exception. This exception is raised whenever a floating-point operation is performed on a subnormal number.

Exceptions are prioritized in the following order: invalid (highest priority), overflow, division, underflow, inexact (lowest priority). On x86-based systems, the denormal operand exception has the lowest priority of all.

The only combinations of standard exceptions that can occur simultaneously in a single operation are overflow with inexact and underflow with inexact. On x86-based systems, the denormal operand exception can occur with any of the five standard exceptions. If trapping on overflow, underflow, and inexact is enabled, the overflow and underflow traps take precedence over the inexact trap; they all take precedence over a denormal operand trap on x86-based systems.