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 27 of file feenablxcpt.c.

  fpu_control_t 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;
  _FPU_SETCW (new_exc);

  return old_exc;