Back to index

glibc  2.9
fsetexcptflg.c File Reference
#include <fenv.h>
#include <math.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.

  fexcept_t temp;

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

  /* Set the desired exception mask.  */
  temp &= ~(excepts & FE_ALL_EXCEPT);
  temp |= (*flagp & excepts & FE_ALL_EXCEPT);

  /* Save state back to the FPU.  */
  _FPU_SETCW (temp);

  return 0;