Back to index

glibc  2.9
Functions
fesetround.c File Reference
#include <fenv.h>
#include <fpu_control.h>

Go to the source code of this file.

Functions

int fesetround (int round)

Function Documentation

int fesetround ( int  round)

Definition at line 25 of file fesetround.c.

{
  fpu_control_t cw;

  if ((round & ~0x3) != 0)
    /* ROUND is no valid rounding mode.  */
    return 1;

  /* Get current state.  */
  _FPU_GETCW (cw);

  /* Set rounding bits.  */
  cw &= ~0x3;
  cw |= round;
  /* Set new state.  */
  _FPU_SETCW (cw);

  return 0;
}