Back to index

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

Go to the source code of this file.


int feenableexcept (int excepts)

Function Documentation

int feenableexcept ( int  excepts)

Definition at line 26 of file feenablxcpt.c.

  unsigned int new_exc, old_exc;

  /* Get the current control word.  */
  _FPU_GETCW (new_exc);

  old_exc = (new_exc & ENABLE_MASK) >> ENABLE_SHIFT;

  excepts &= FE_ALL_EXCEPT;

  new_exc |= excepts << ENABLE_SHIFT;
  new_exc &= ~_FPU_RESERVED;
  _FPU_SETCW (new_exc);

  return old_exc;