Back to index

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

Go to the source code of this file.


int fesetexceptflag (const fexcept_t *flagp, int excepts)

Function Documentation

int fesetexceptflag ( const fexcept_t flagp,
int  excepts 

Definition at line 25 of file fsetexcptflg.c.

  fpu_control_t temp;

  /* Get the current exceptions.  */
  _FPU_GETCW (temp);

  /* Make sure the flags we want restored are legal.  */
  excepts &= FE_ALL_EXCEPT;

  /* Now clear the bits called for, and copy them in from flagp. Note that
     we ignore all non-flag bits from *flagp, so they don't matter.  */
  temp = (temp & ~excepts) | (*flagp & excepts);

  _FPU_SETCW (temp);

  /* Success.  */
  return 0;