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);
DESCRIPTION
fesetround(round) sets the current rounding direction to the
direction specified by round, which must be one of the fol-
lowing 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 zero if the requested rounding mode is
established and returns a nonzero value otherwise.
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
______________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|____________________|________________________________|
| Availability | SPROm9xs |
| Interface Stability| Standard, Obsolete (see below)|
| MT-Level | MT-Safe |
|____________________|________________________________|
The fesetround and fegetround functions are defined by the
C99 standard. Their interface stability classification is
Standard.
In 1996, when these functions were initially implemented,
the C99 draft standard defined fesetround to return a
nonzero value if the requested rounding mode is established
and zero otherwise, i.e., the opposite of the definition in
the final standard. To accommodate the possibility that the
standard might change, libm9x provided an alternate function
named fesetround96 that followed the C99 draft at that time.
This and other functions with the "96" suffix were declared
in the <fenv96.h> header file. Now that C99 has been final-
ized, these suffixed functions and the <fenv96.h> header
file are no longer necessary. Their interface stability
classification is Obsolete.
The <fenv96.h> header file may be removed in a subsequent
release. Application programs should instead use the stan-
dard functions and the <fenv.h> header file.
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 loca-
tion in which the compilers are installed (/opt/SUNWspro by
default). See the Numerical Computation Guide for addi-
tional information about linking with libm9x.