HP-UX Reference (11i v1 00/12) - 3 Library Functions A-M (vol 6)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/!!!intro.3c
________________________________________________________________
___ ___
f
fegetround(3M) fegetround(3M)
NAME
fegetround() - get floating-point rounding direction mode
SYNOPSIS
#include <fenv.h>
int fegetround(void);
DESCRIPTION
The fegetround() function gets the current rounding direction.
The default rounding direction mode is round to nearest (FE_TONEAREST ).
The ISO/ANSI C committee has approved the fegetround() function for inclusion in the C9X draft
standard.
To use this function, compile either with the default -Ae option or with the -Aa and -D_HPUX_SOURCE
options. Make sure your program includes <fenv.h>. Link in the math library by specifying -lm on the
compiler or linker command line.
For more information, see the HP-UX Floating-Point Guide.
RETURN VALUE
The
fegetround() function returns the value of the rounding direction macro representing the current
rounding direction. The return value will match one of the macros FE_TONEAREST , FE_UPWARD,
FE_DOWNWARD , and FE_TOWARDZERO.
ERRORS
No errors are defined.
EXAMPLE
Save, set, and restore the rounding direction.
#include <fenv.h>
/*...*/
{
int save_round;
save_round = fegetround();
fesetround(FE_UPWARD);
/*...*/
fesetround(save_round);
/*...*/
}
SEE ALSO
fesetround(3M), fenv(5).
HP-UX Release 11i: December 2000 − 1 − Section 3−−223
___
___