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 below section Restrictions for IEEE Intrinsic Procedures).

For example:

The compiler establishes the initial IEEE floating-point environment. The user can affect this initial environment with several different command-line options. For the IEEE intrinsic module procedures to work as defined by the Fortran Standard, the following command lines options must be set as follows:

Restrictions for IEEE Intrinsic Procedures

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

IEEE_CLASS

IEEE_REM

IEEE_COPY_SIGN

IEEE_RINT

IEEE_FMA

IEEE_SCALB

IEEE_IS_FINITE

IEEE_SET_ROUNDING_MODE 3

IEEE_NEGATIVE

IEEE_SIGNALING_EQ

IEEE_INT

IEEE_SIGNALING_GE

IEEE_IS_NORMAL

IEEE_SIGNALING_GT

IEEE_LOGB

IEEE_SIGNALING_LE

IEEE_MAX_NUM

IEEE_SIGNALING_LT

IEEE_MAX_NUM_MAG

IEEE_SIGNALING_NE

IEEE_MIN_NUM

IEEE_SIGNBIT

IEEE_MIN_NUM_MAG

IEEE_SUPPORT_DENORMAL

IEEE_NEXT_AFTER

IEEE_SUPPORT_DIVIDE

IEEE_NEXT_DOWN 1

IEEE_SUPPORT_INF

IEEE_NEXT_UP 1

IEEE_SUPPORT_IO

IEEE_QUIET_EQ

IEEE_SUPPORT_NAN

IEEE_QUIET_GE

IEEE_SUPPORT_ROUNDING

IEEE_QUIET_GT

IEEE_SUPPORT_SQRT

IEEE_QUIET_LE

IEEE_SUPPORT_SUBNORMAL

IEEE_QUIET_LT

IEEE_SUPPORT_UNORDERED

IEEE_QUIET_NE

IEEE_SUPPORT_VALUE

IEEE_REAL 2

IEEE_VALUE

1 IEEE_SUPPORT_INF() must be true if IEEE_NEXT_DOWN is called with the argument -HUGE (X) or if IEEE_NEXT_UP is called with the argument HUGE (X).

2 IEEE_SUPPORT_DATATYPE (IEEE_REAL (A, KIND)) must also be true.

3 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):