Back to index

glibc  2.9
fclrexcpt.c File Reference
#include <fenv.h>
#include <fenv_libc.h>
#include <fpu_control.h>
#include <shlib-compat.h>

Go to the source code of this file.


int __feclearexcept (int excepts)
 versioned_symbol (libm, __feclearexcept, feclearexcept, GLIBC_2_2)

Function Documentation

int __feclearexcept ( int  excepts)

Definition at line 28 of file fclrexcpt.c.

  fpu_control_t cw;

  /* Mask out unsupported bits/exceptions.  */
  excepts &= FE_ALL_EXCEPT;

  /* Read the complete control word.  */
  _FPU_GETCW (cw);

  /* Clear exception flag bits and cause bits.  EF bits are cleared by
     assigning 1 to them (and there's no way to set them); other bits
     are copied normally.  */

  cw &= ~((excepts << CAUSE_SHIFT) | FE_ALL_EXCEPT);
  cw |= excepts;

  /* Put the new data in effect.  */
  _FPU_SETFCW (cw);

  /* Success.  */
  return 0;
versioned_symbol ( libm  ,
__feclearexcept  ,
feclearexcept  ,