set_ieee_rounding_mode(3I)
SET_IEEE_ROUNDING_MODE - Alters current floating-point rounding mode state and restores the floating-point rounding mode before exiting a procedure
As shipped in IRIX 6.5.30. Last changed in IRIX 6.5.19.
NAME SET_IEEE_ROUNDING_MODE - Alters current floating-point rounding mode state and restores the floating-point rounding mode before exiting a procedure SYNOPSIS SET_IEEE_ROUNDING_MODE ([ROUNDING_MODE=]rounding_mode) STANDARDS Fortran extension IEEE Standard for Binary Floating-point Arithmetic DESCRIPTION The SET_IEEE_ROUNDING_MODE intrinsic subroutine is typically used to alter the current floating-point rounding mode state and to restore the caller's floating-point rounding mode just before exiting a procedure. It accepts the following argument: rounding_mode Must be scalar and of an integer type that occupies a full word. It is an INTENT(IN) argument. The floating-point rounding mode is set to the rounding mode indicated by rounding_mode. rounding_mode must have one of the values represented by the following named constants: * IEEE_RM_NEAREST * IEEE_RM_POS_INFINITY * IEEE_RM_ZERO * IEEE_RM_NEG_INFINITY rounding_mode is assumed to have been set through an invocation of GET_IEEE_ROUNDING_MODE(3I). The IEEE_REAL(3I) and IEEE_INT(3I) functions are the only routines supplied by SGI that examine the setting of the rounding mode on IRIX systems. 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 EXAMPLES ! Assume the following code is executing on a machine where default ! integer occupies a full word. INTEGER save_rounding_mode ! Save the current rounding mode then change the rounding mode ! to round to positive infinity. CALL GET_IEEE_ROUNDING_MODE(save_rounding_mode) CALL SET_IEEE_ROUNDING_MODE(IEEE_RM_POS_INFINITY) ! Calculate the upper bound on sum. DO i = 1, n xup(i) = y(i) + z(i) END DO ! Reset to round to negative infinity mode. CALL SET_IEEE_ROUNDING_MODE(IEEE_RM_NEG_INFINITY) ! Calculate lower bound on sum. DO i = 1, n xdn(i) = y(i) + z(i) END DO ! Restore original rounding mode and return to the caller. CALL SET_IEEE_ROUNDING_MODE(save_rounding_mode) SEE ALSO GET_IEEE_ROUNDING_MODE(3I)