Previous Page
Next Page

fegetround

Determines the current rounding direction in the floating-point environment

#include <fenv.h>
int fegetround( void );

The fegetround( ) function obtains the current rounding direction. The integer return value is negative if the rounding direction is undetermined, or equal to one of the following macros, defined in fenv.h as integer constants, if the function is successful:


FE_DOWNWARD

Round down to the next lower integer.


FE_UPWARD

Round up to the next greater integer.


FE_TONEAREST

Round up or down toward whichever integer is nearest.


FE_TOWARDZERO

Round positive values downward and negative values upward.

Example

See the examples for fmod( ) and fesetround( ) in this chapter.

See Also

fesetround( ), fegetenv( ), fegetexceptflag( )


Previous Page
Next Page