Back to index

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

Go to the source code of this file.


int feraiseexcept (int excepts)

Function Documentation

int feraiseexcept ( int  excepts)

Definition at line 26 of file fraiseexcpt.c.

  fpu_control_t cw;

  /* Get current state.  */
  _FPU_GETCW (cw);

  /* Set flag bits (which are accumulative), and *also* set the 
     cause bits. The setting of the cause bits is what actually causes
     the hardware to generate the exception, if the corresponding enable
     bit is set as well.  */

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

  /* Set new state.  */
  _FPU_SETCW (cw);

  return 0;