Intrinsic Module Subroutine (Generic): Restores the current IEEE floating-point modes. This is an impure subroutine.
USE, INTRINSIC :: IEEE_EXCEPTIONS
CALL IEEE_SET_MODES (modes)
modes |
(Input) Must be scalar and of type TYPE (IEEE_MODES_TYPE). Its value must be a value that was assigned to the modes argument of a previous call to IEEE_GET_MODES. A call to IEEE_SET_MODES restores the value of the floating-point modes to the state at the time IEEE_GET_MODES was called. |
Consider the following:
USE, INTRINSIC :: IEEE_EXCEPTIONS ! Can also use IEEE_ARITHMETIC
TYPE (IEEE_MODE_TYPE) MODES
...
CALL IEEE_GET_MODES (MODES) ! Stores the floating-point modes
CALL IEEE_SET_UNDERFLOW_MODE (.TRUE.) ! Sets the underflow mode to gradual
...
CALL IEEE_SET_MODES (MODES) ! Restores the floating-point modes