Back to index

glibc  2.9
fesetround.c File Reference
#include <fenv.h>
#include <fpu_control.h>
#include <unistd.h>
#include <ldsodefs.h>
#include <dl-procinfo.h>
#include <sysdep.h>

Go to the source code of this file.


int fesetround (int round)

Function Documentation

int fesetround ( int  round)

Definition at line 29 of file fesetround.c.

  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
      fpu_control_t temp;

      switch (round)
       case FE_TONEAREST:
       case FE_UPWARD:
       case FE_DOWNWARD:
       case FE_TOWARDZERO:
         _FPU_GETCW (temp);
         temp = (temp & ~FE_TOWARDZERO) | round;
         _FPU_SETCW (temp);
         return 0;
         return 1;
  else if (round == FE_TONEAREST)
    /* This is the only supported rounding mode for soft-fp.  */
    return 0;

  /* Unsupported, so fail.  */
  return 1;