Intel® Fortran Compiler 17.0 Developer Guide and Reference

IEEE Intrinsic Modules and Procedures

Intel® Fortran includes IEEE intrinsic modules that support IEEE arithmetic and exception handling. The modules contain derived data types that include named constants for controlling the level of support, and intrinsic module procedures.

To include an IEEE module in your program, specify the intrinsic module name in a USE statement; for example:

USE,INTRINSIC :: IEEE_ARITHMETIC

You must include the INTRINSIC attribute or the processor will look for a non-intrinsic module. Once you include a module, all related intrinsic procedures are defined.

The following three IEEE intrinsic modules are described in this section:

Determining Availability of IEEE Features

Before using a particular IEEE feature, you can determine whether your processor supports it by using the IEEE inquiry functions (listed in Table 1).

For example:

Restrictions for IEEE Intrinsic Procedures

The following intrinsic procedures can only be invoked if IEEE_SUPPORT_DATATYPE is true for their arguments:

IEEE_CLASS

IEEE_SUPPORT_DENORMAL

IEEE_COPY_SIGN

IEEE_SUPPORT_DIVIDE

IEEE_IS_FINITE

IEEE_SUPPORT_INR

IEEE_NEGATIVE

IEEE_SUPPORT_IO

IEEE_IS_NORMAL

IEEE_SUPPORT_NAN

IEEE_LOGB

IEEE_SUPPORT_ROUNDING

IEEE_NEXT_AFTER

IEEE_SUPPORT_SQRT

IEEE_REM

IEEE_SUPPORT_UNORDERED

IEEE_RINT

IEEE_SUPPORT_VALUE

IEEE_SCALB

IEEE_VALUE

IEEE_SET_ROUNDING_MODE1

IEEE_SUPPORT_ROUNDING

1 IEEE_SUPPORT_ROUNDING(ROUND_VALUE, X) must also be true.

For example, the IEEE_IS_NORMAL(X) function can only be invoked if IEEE_SUPPORT_DATATYPE(X) has the value true. Consider the following:

USE, INTRINSIC :: IEEE_ARITHMETIC
...
  IF IEEE_SUPPORT_DATATYPE(X) THEN
    IF IEEE_IS_NORMAL(X) THEN
      PRINT *, ' X is a "normal" '
    ELSE
      PRINT *, ' X is not "normal" '
    ENDIF
  ELSE
    PRINT *, ' X is not a supported IEEE type '
  ENDIF
...

Certain other IEEE intrinsic module procedures have similar restrictions:

For intrinsic module function IEEE_CLASS(X), some of the possible return values also have restrictions. These restrictions are also true for argument CLASS in intrinsic module function IEEE_VALUE(X, CLASS):