Back to index

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

Go to the source code of this file.


int feclearexcept (int excepts)

Function Documentation

int feclearexcept ( int  excepts)

Definition at line 26 of file fclrexcpt.c.

  int 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. If the cause bit is not
     cleared, the next CTC instruction (just below) will re-generate the
     exception.  */

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

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

  /* Success.  */
  return 0;