XL Fortran for AIX 8.1

Language Reference


Rules for Floating-Point Status

An exception flag set to signaling remains signaling until set to quiet by either the IEEE_SET_FLAG or IEEE_SET_STATUS subroutines.

The compiler ensures that a call from scoping units using the IEEE_EXCEPTIONS or IEEE_ARITHMETIC intrinsic modules does not change the floating-point status other than by setting exception flags to signaling.

If a flag is set to signaling on entry into a scoping unit that uses the IEEE_EXCEPTIONS or IEEE_ARITHMETIC modules, the flag is set to quiet and then restored to signaling when leaving that scoping unit.

In a scoping unit that uses the IEEE_EXCEPTIONS or IEEE_ARITHMETIC modules, the rounding and halting modes do not change on entry. On return, the rounding and halting modes are the same as on entry.

Evaluating a specification expression can cause an exception to signal.

Exception handlers must not use the IEEE_EXCEPTIONS or IEEE_ARITHMETIC modules.

The following rules apply to format processing and intrinsic procedures:

In a sequence of statements that has no invocations of IEEE_GET_FLAG, IEEE_SET_FLAG, IEEE_GET_STATUS, IEEE_SET_HALTING, or IEEE_SET_STATUS, the following applies. If the execution of an operation would cause an exception to signal but after execution of the sequence no value of a variable depends on the operation, whether the exception is signaling depends on the optimization level. Optimization transformations may eliminate some code, and thus IEEE exception flags signaled by the eliminated code will not signal.

An exception will not signal if this could arise only during execution of an operation beyond those required or permitted by the standard.

For procedures defined by means other than Fortran, it is the responsibility of the user to preserve floating-point status.

XL Fortran does not always detect floating-point exception conditions for extended precision values. If you turn on floating-point exception trapping in programs that use extended precision, XL Fortran may also generate signals in cases where an exception does not really occur. See Detecting and Trapping Floating-Point Exceptions in the User's Guide for more information.

Fortran 2000 IEEE derived types, constants, and operators are incompatible with the floating-point and inquiry procedures in xlf_fp_util, fpsets, and fpgets procedures. A value obtained from an IEEE procedure cannot be used in non-IEEE procedures. Within a single scoping unit, do not mix calls to the procedures in xlf_fp_util, fpsets, and fpgets with calls to the IEEE procedures. These procedures may change the floating-point status when called from scoping units that use the IEEE_EXCEPTIONS or IEEE_ARITHMETIC modules.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]