enable_ieee_interrupt(3I)

ENABLE_IEEE_INTERRUPT, DISABLE_IEEE_INTERRUPT - Enables or disables floating-point interrupt

Showing IRIX 6.5.30 (default release). Last changed in IRIX 6.5.19.

NAME
     ENABLE_IEEE_INTERRUPT, DISABLE_IEEE_INTERRUPT - Enables or disables
     floating-point interrupt

SYNOPSIS
     ENABLE_IEEE_INTERRUPT ([INTERRUPT=]interrupt)

     DISABLE_IEEE_INTERRUPT ([INTERRUPT=]interrupt)

STANDARDS
     Fortran extension

     IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
     The ENABLE_IEEE_INTERRUPT intrinsic subroutine enables the specified
     floating-point interrupt.

     The DISABLE_IEEE_INTERRUPT intrinsic subroutine disables the specified
     floating-point interrupt.

     They accept the following argument:

     interrupt      Must be of an integer type that occupies a full word.
                    If interrupt is an array, it must be 1-dimensional.
                    The single value in the scalar argument case, or each
                    element in the array argument case, must be set to one
                    of the values represented by one of the following named
                    constants:

                    * IEEE_NTPT_INEXACT_RESULT

                    * IEEE_NTPT_UNDERFLOW

                    * IEEE_NTPT_OVERFLOW

                    * IEEE_NTPT_DIV_BY_ZERO

                    * IEEE_NTPT_INVALID_OPR

                    * IEEE_NTPT_ALL (all interrupts in this list)

     The IEEE_INEXACT_RESULT and IEEE_UNDERFLOW interrupts should be
     disabled before the execution of any I/O statement that involves
     conversion to prevent arithmetic exceptions during the execution of
     those I/O statements.

     The name of this intrinsic 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 FTN_IEEE_DEFINITIONS

     The hardware ignores attempts to set these bits.

CAUTIONS
     Care should be taken before enabling interrupts on inexact results
     because inexact results are so prevalent.  In particular, inexact
     results will occur while performing operations which are not generally
     regarded as floating-point operations.  These include, but are not
     limited to, Fortran I/O statements, memory allocations and DO loop
     iteration count computations.

RETURN VALUES
     Upon return from ENABLE_IEEE_INTERRUPT, the interrupt, or each element
     of interrupt, is enabled.  If interrupt, or any element of interrupt,
     has the value IEEE_NTPT_ALL, all interrupts are enabled.

     Upon return from DISABLE_IEEE_INTERRUPT, the interrupt, or each
     element of interrupt, is disabled.  If interrupt, or any element of
     interrupt, has the value IEEE_NTPT_ALL, all interrupts are disabled.

EXAMPLES
     The following program can be run on IRIX systems:

          SUBROUTINE calculate
          USE FTN_IEEE_DEFINITIONS

          INTEGER interrupt_status

          ! Save the current floating point interrupt status.

          CALL GET_IEEE_INTERRUPTS(interrupt_status)

          ! Enable interrupt on divide by zero if it hasn't already been
          ! enabled.

          IF (.NOT. TEST_IEEE_INTERRUPT(IEEE_NTPT_DIV_BY_ZERO))  &
          CALL ENABLE_IEEE_INTERRUPT(IEEE_NTPT_DIV_BY_ZERO)

          ! Perform a floating point divide.
          ! If z = 0, the program error terminates.

          x  = y / z

          ! Disable interrupt on divide by zero.

          CALL DISABLE_IEEE_INTERRUPT(IEEE_NTPT_DIV_BY_ZERO))

          ! If z = 0, q = Infinity (quietly).

          q  = y / z

          ! Restore the floating point interrupt status to what it was
          ! when this procedure was called.

          CALL SET_IEEE_INTERRUPTS(interrupt_status)

          END SUBROUTINE