SET_IEEE_ROUNDING_MODE(3I) Last changed: 1-6-98
SET_IEEE_ROUNDING_MODE - Alters current floating-point rounding mode
state and restores the floating-point rounding mode before exiting a
procedure
SET_IEEE_ROUNDING_MODE ([ROUNDING_MODE=]rounding_mode)
UNICOS/mk and IRIX systems
CRAY T90 systems that support IEEE arithmetic
CF90 and MIPSpro 7 Fortran 90 compiler extension to Fortran 90
IEEE Standard for Binary Floating-point Arithmetic
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 Cray Research that examine the setting of the rounding
mode on CRAY T90 systems that support IEEE arithmetic, UNICOS/mk
systems, and IRIX systems.
The name of this intrinsic cannot be passed as an argument.
The IEEE intrinsic procedures use the named constants contained in a
system module, so you must include one of the following statements in
your program:
* On UNICOS and UNICOS/mk systems: USE CRI_IEEE_DEFINITIONS
* On UNICOS, UNICOS/mk, and IRIX systems: USE FTN_IEEE_DEFINITIONS
The CRI_IEEE_DEFINITIONS module is obsolescent. It will be removed
for the CF90 4.0 release.
! 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)
GET_IEEE_ROUNDING_MODE(3I)
Intrinsic Procedures Reference Manual, publication SR-2138, for the
printed version of this man page.
SET_IEEE_ROUNDING_MODE(3I) Last changed: 1-6-98
SET_IEEE_ROUNDING_MODE - Alters current floating-point rounding mode
state and restores the floating-point rounding mode before exiting a
procedure
SET_IEEE_ROUNDING_MODE ([ROUNDING_MODE=]rounding_mode)
UNICOS/mk and IRIX systems
CRAY T90 systems that support IEEE arithmetic
CF90 and MIPSpro 7 Fortran 90 compiler extension to Fortran 90
IEEE Standard for Binary Floating-point Arithmetic
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 Cray Research that examine the setting of the rounding
mode on CRAY T90 systems that support IEEE arithmetic, UNICOS/mk
systems, and IRIX systems.
The name of this intrinsic cannot be passed as an argument.
The IEEE intrinsic procedures use the named constants contained in a
system module, so you must include one of the following statements in
your program:
* On UNICOS and UNICOS/mk systems: USE CRI_IEEE_DEFINITIONS
* On UNICOS, UNICOS/mk, and IRIX systems: USE FTN_IEEE_DEFINITIONS
The CRI_IEEE_DEFINITIONS module is obsolescent. It will be removed
for the CF90 4.0 release.
! 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)
GET_IEEE_ROUNDING_MODE(3I)
Intrinsic Procedures Reference Manual, publication SR-2138, for the
printed version of this man page.
[ Back ]
|