*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> f90/set_ieee_rounding_mode (3)              
Title
Content
Arch
Section
 

Contents


SET_IEEE_ROUNDING_MODE(3I)			       Last changed: 1-6-98

NAME    [Toc]    [Back]

     SET_IEEE_ROUNDING_MODE - Alters current floating-point rounding mode
     state and restores	the floating-point rounding mode before	exiting	a
     procedure

SYNOPSIS    [Toc]    [Back]

     SET_IEEE_ROUNDING_MODE ([ROUNDING_MODE=]rounding_mode)

IMPLEMENTATION    [Toc]    [Back]

     UNICOS/mk and IRIX	systems

     CRAY T90 systems that support IEEE	arithmetic

STANDARDS    [Toc]    [Back]

     CF90 and MIPSpro 7	Fortran	90 compiler extension to Fortran 90

     IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION    [Toc]    [Back]

     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.

NOTES    [Toc]    [Back]

     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.

EXAMPLES    [Toc]    [Back]

	! 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    [Toc]    [Back]

      
      
     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

NAME    [Toc]    [Back]

     SET_IEEE_ROUNDING_MODE - Alters current floating-point rounding mode
     state and restores	the floating-point rounding mode before	exiting	a
     procedure

SYNOPSIS    [Toc]    [Back]

     SET_IEEE_ROUNDING_MODE ([ROUNDING_MODE=]rounding_mode)

IMPLEMENTATION    [Toc]    [Back]

     UNICOS/mk and IRIX	systems

     CRAY T90 systems that support IEEE	arithmetic

STANDARDS    [Toc]    [Back]

     CF90 and MIPSpro 7	Fortran	90 compiler extension to Fortran 90

     IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION    [Toc]    [Back]

     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.

NOTES    [Toc]    [Back]

     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.

EXAMPLES    [Toc]    [Back]

	! 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    [Toc]    [Back]

      
      
     GET_IEEE_ROUNDING_MODE(3I)

     Intrinsic Procedures Reference Manual, publication	SR-2138, for the
     printed version of	this man page.

[ Back ]
 Similar pages
Name OS Title
set_ieee_interrupts IRIX Restores floating-point interrupt status before exiting a procedure
set_ieee_exceptions IRIX Restores the caller's floating-point status prior to exiting a procedure
get_ieee_rounding_mode IRIX Returns current floating-point rounding mode
fenv Linux C99 floating point rounding and exception handling
set_ieee_status IRIX Restores floating-point status
fpmode IRIX run a command in specified floating point and/or memory mode
test_ieee_interrupt IRIX Returns the state of a floating-point interrupt
test_ieee_exception IRIX Returns the state of a floating-point exception
get_ieee_status IRIX floating-point status upon entry to a procedure
ipfs FreeBSD saves and restores information for NAT and state tables.
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service