Back to index

glibc  2.9
Functions
fsetexcptflg.c File Reference
#include <fenv.h>
#include <math.h>
#include <fpu_control.h>
#include <shlib-compat.h>

Go to the source code of this file.

Functions

int __fesetexceptflag (const fexcept_t *flagp, int excepts)
 versioned_symbol (libm, __fesetexceptflag, fesetexceptflag, GLIBC_2_2)

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) << FE_EXCEPT_SHIFT);
  temp |= (*flagp & excepts & FE_ALL_EXCEPT) << FE_EXCEPT_SHIFT;

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

  /* Success.  */
  return 0;
}
versioned_symbol ( libm  ,
__fesetexceptflag  ,
fesetexceptflag  ,
GLIBC_2_2   
)