Welcome to mirror list, hosted at ThFree Co, Russian Federation.

fetestexcept.c « mingwex « mingw « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6934ed9259309a816db52632ee66d3fcba7b835d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <fenv.h> 
/* 7.6.2.5 
   The fetestexcept function determines which of a specified subset of
   the exception flags are currently set. The excepts argument
   specifies the exception flags to be queried.
   The fetestexcept function returns the value of the bitwise OR of the
   exception macros corresponding to the currently set exceptions
   included in excepts. */

int fetestexcept (int excepts)
{
  unsigned short _sw;
  __asm__ ("fnstsw %%ax" : "=a" (_sw));
  return _sw & excepts & FE_ALL_EXCEPT;
}