fesetround(3M)
NAME
fesetround, fegetround − control floating point rounding direction modes
SYNOPSIS
cc [ flag ... ] file ... -R/opt/SUNWspro/lib -L/opt/SUNWspro/lib -lm9x [ library ... ]
#include <fenv.h>
int fesetround(int round);
int fegetround(void);
#include <fenv96.h>
int fesetround96(int round);
int fegetround96(void);
DESCRIPTION
fesetround(round) sets the current rounding direction to the direction specified by round, which must be one of the following values (defined in <fenv.h>):
FE_TONEAREST round to nearest
FE_UPWARD round toward positive infinity
FE_DOWNWARD round toward negative infinity
FE_TOWARDZERO round toward zero
The default direction is FE_TONEAREST (unless it is changed by the -fround compiler flag).
fegetround() returns the current rounding direction.
RETURN VALUES
fesetround returns a nonzero value if the requested rounding mode is established and returns zero otherwise.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
| Availability | SPROm9xs |
| Interface Stability | Stable (see below) |
| MT-Level | MT-Safe |
The fegetround and fesetround functions are defined by the C9X draft standard. Should the final standard change the definitions of these functions, new conforming implementations will be provided in a subsequent major release. Therefore, these functions should currently be considered Evolving.
To maintain compatibility with the present C9X definitions, programs may instead use the fegetround96 and fesetround96 functions. Each of these functions performs the same operation as its counterpart without the 96 suffix. The suffixed functions, however, will retain their present definitions regardless of changes to the C9X draft. These functions are Stable.
Note that <fenv.h> currently redefines the names of the standard functions to their suffixed counterparts so that compiled programs will invoke the suffixed functions. Once the C9X draft is adopted as a standard, those redefinitions will be removed from <fenv.h>. Any program recompiled thereafter that uses the standard, unsuffixed names will then invoke the standard functions (with their final definitions), but previously compiled programs will be unaffected.
SEE ALSO
fegetenv(3M), fesetprec(3M), attributes(5)
Numerical Computation Guide
NOTES
As shown in the synopsis, the recommended way to link with libm9x using cc is to specify
-Rinstall-path/lib -Linstall-path/lib -lm9x
on the command line, where install-path refers to the location in which the compilers are installed (/opt/SUNWspro by default). See the Numerical Computation Guide or the READMEs/math_libraries file in the compiler installation area for additional information about linking with libm9x.
SunOS 5.0 — Last change: 06/25/97