ieee_set_halting_mode
- Date:
10-12-2011
NAME
IEEE_SET_HALTING_MODE - Controls the halting or continuation of program execution when a floating-point exception occurs
SYNOPSIS
CALL IEEE_SET_HALTING_MODE ( [FLAG=] flag [, [HALTING=] halting] )
TYPE(IEEE_FLAG_TYPE) :: flag = flag_constant
LOGICAL :: halting
IMPLEMENTATION
Cray Linux Environment (CLE)
STANDARDS
Fortran
IEEE Standard for Binary Floating-point Arithmetic
DESCRIPTION
The IEEE_SET_HALTING_MODE intrinsic subroutine is called to change action after a floating-point exception specified by flag is triggered. It accepts the following arguments:
- flag
May be a scalar or array of type TYPE(IEEE_FLAG_TYPE). The flag may be one of the named constants:
IEEE_DIVIDE_BY_ZERO
IEEE_INEXACT
IEEE_INVALID
IEEE_OVERFLOW
IEEE_UNDERFLOW
No two elements of flag may contain the same value.
- halting
Must be conformable with flag and must be of type logical. It is an INTENT(IN) argument. If an element has the value true, the floating-point exception will halt execution when it is raised. Otherwise, the floating-point exception will continue after this exception.
The name of this intrinsic subroutine cannot be passed as an argument.
NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include the following statement in your program:
USE, INTRINSIC :: IEEE_EXCEPTIONS
EXAMPLES
Example 1:
USE, INTRINSIC :: IEEE_ARITHMETIC
USE, INTRINSIC :: IEEE_EXCEPTIONS
LOGICAL ovflo_halt_support
LOGICAL ovflo_stop, ovflo_continue
REAL xdeflt
TYPE(IEEE_FLAG_TYPE) :: ovflo_halt_except = IEEE_OVERFLOW
TYPE(IEEE_FLAG_TYPE) :: ovflo_halts = IEEE_OVERFLOW
ovflo_halt_support = IEEE_SUPPORT_HALTING(ovflo_halt_except,xdeflt)
IF (.NOT. ovflo_halt_support) STOP 'NO_HALT_SUPPORT'
CALL IEEE_GET_HALTING_MODE(ovflo_halts, ovflo_stop)
IF ( ovflo_stop) THEN
ovflo_continue = .FALSE.
CALL IEEE_SET_HALTING_MODE(ovflo_halts, ovflo_continue)
ENDIF
! floatingpt operation on xdeflt
IF ( ovflo_stop) THEN
CALL IEEE_GET_HALTING_MODE(ovflo_halts, ovflo_stop)
ENDIF
SEE ALSO
ieee_get_halting_mode(3i)