Back to index

glibc  2.9
Functions
fedisblxcpt.c File Reference
#include <fenv_libc.h>

Go to the source code of this file.

Functions

int fedisableexcept (int excepts)

Function Documentation

int fedisableexcept ( int  excepts)

Definition at line 24 of file fedisblxcpt.c.

{
  fenv_union_t fe;
  int result, new;

  result = __fegetexcept ();

  if ((excepts & FE_ALL_INVALID) == FE_ALL_INVALID)
    excepts = (excepts | FE_INVALID) & ~ FE_ALL_INVALID;

  fe.fenv = fegetenv_register ();
  if (excepts & FE_INEXACT)
    fe.l[1] &= ~(1 << (31 - FPSCR_XE));
  if (excepts & FE_DIVBYZERO)
    fe.l[1] &= ~(1 << (31 - FPSCR_ZE));
  if (excepts & FE_UNDERFLOW)
    fe.l[1] &= ~(1 << (31 - FPSCR_UE));
  if (excepts & FE_OVERFLOW)
    fe.l[1] &= ~(1 << (31 - FPSCR_OE));
  if (excepts & FE_INVALID)
    fe.l[1] &= ~(1 << (31 - FPSCR_VE));
  fesetenv_register (fe.fenv);

  new = __fegetexcept ();
  if (new == 0 && result != 0)
    (void)__fe_mask_env ();

  if ((new & excepts) != 0)
    result = -1;
  return result;
}

Here is the call graph for this function: