Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

IEEE_EXCEPTIONS Intrinsic Module

The IEEE_EXCEPTIONS module contains derived data types that include named constants for controlling the level of support, and intrinsic module procedures.

The derived types in the intrinsic modules have components that are private. The IEEE_EXCEPTIONS intrinsic module supports the setting, clearing, saving, restoring, or testing of exception flags. It defines the following derived types:

  • IEEE_FLAG_TYPE: Identifies an exception flag for errors that occur during an IEEE arithmetic operation or assignment. Its values are the following named constants:

    IEEE_INVALID

    IEEE_DIVIDE_BY_ZERO

    IEEE_OVERFLOW

    IEEE_INEXACT

    IEEE_UNDERFLOW

    Each of the above exceptions has a flag whose value is either quiet or signaling. The initial value is quiet and it signals when the associated exception occurs. To determine the value of a flag, use intrinsic module subroutine IEEE_GET_FLAG. To change the status for a flag, use intrinsic module subroutine IEEE_SET_FLAG or IEEE_SET_STATUS.

    If a flag is signaling on entry to a procedure, the processor sets it to quiet on entry and restores it to signaling on return.

    If a flag is quiet on entry to a procedure with access to modules IEEE_ARITHMETIC or IEEE_EXCEPTIONS, and is signaling on return, the processor will not restore it to quiet.

    The IEEE_FLAG_TYPE module also defines the following named array constants:

    • IEEE_USUAL=(/IEEE_OVERFLOW,IEEE_DIVIDE_BY_ZERO, IEEE_INVALID/)

    • IEEE_ALL=(/IEEE_USUAL,IEEE_UNDERFLOW,IEEE_INEXACT/)

  • IEEE_MODES_TYPE: The floating-point modes are the values of the rounding modes, underflow mode, and halting mode. They can be saved in a variable of type IEEE_MODES_TYPE by calling the subroutine IEEE_GET_MODES and restored by calling the subroutine IEEE_SET_MODES.

  • IEEE_STATUS_TYPE: The floating-point status can be saved in a variable of type IEEE_STATUS_TYPE by calling the subroutine IEEE_GET_STATUS and restored by calling the subroutine IEEE_SET_STATUS.

The IEEE_ARITHMETIC module includes support for IEEE_EXCEPTIONS module, and public entities in IEEE_EXCEPTIONS module are also public in the IEEE_ARITHMETIC module.

To see a summary of all the IEEE_EXCEPTIONS intrinsic procedures, see IEEE Intrinsic Modules Quick Reference Tables