fesetround()

Set the floating-point rounding direction

Synopsis:

#include <fenv.h>

int fesetround( int round );

Arguments:

round
The rounding direction; one of the following:
  • FE_DOWNWARD
  • FE_TONEAREST
  • FE_TOWARDZERO
  • FE_UPWARD

Library:

libm

Use the -l m option to qcc to link against this library.

Description:

The fesetround() function sets the current floating-point rounding direction. If the value of round isn't a valid rounding direction macro, the rounding direction isn't changed. The FLT_ROUNDS macro reflects the updated rounding direction.

Returns:

0 on success, or a nonzero value if an error occurred.

Classification:

C99, POSIX 1003.1

Safety:  
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes