numpy  2.0.0
include/numpy/fenv/fenv.h File Reference
#include <sys/cdefs.h>
#include <sys/types.h>

Go to the source code of this file.

Data Structures

struct  fenv_t

Defines

#define FE_INVALID   0x01
#define FE_DENORMAL   0x02
#define FE_DIVBYZERO   0x04
#define FE_OVERFLOW   0x08
#define FE_UNDERFLOW   0x10
#define FE_INEXACT   0x20
#define FE_ALL_EXCEPT
#define FE_TONEAREST   0x0000
#define FE_DOWNWARD   0x0400
#define FE_UPWARD   0x0800
#define FE_TOWARDZERO   0x0c00
#define _ROUND_MASK
#define FE_DFL_ENV   (&npy__fe_dfl_env)
#define __fldcw(__cw)   __asm __volatile("fldcw %0" : : "m" (__cw))
#define __fldenv(__env)   __asm __volatile("fldenv %0" : : "m" (__env))
#define __fnclex()   __asm __volatile("fnclex")
#define __fnstenv(__env)   __asm __volatile("fnstenv %0" : "=m" (*(__env)))
#define __fnstcw(__cw)   __asm __volatile("fnstcw %0" : "=m" (*(__cw)))
#define __fnstsw(__sw)   __asm __volatile("fnstsw %0" : "=am" (*(__sw)))
#define __fwait()   __asm __volatile("fwait")

Typedefs

typedef __uint16_t fexcept_t

Functions

static __inline int feclearexcept (int __excepts)
static __inline int fegetexceptflag (fexcept_t *__flagp, int __excepts)
static __inline int fesetexceptflag (const fexcept_t *__flagp, int __excepts)
static __inline int feraiseexcept (int __excepts)
static __inline int fetestexcept (int __excepts)
static __inline int fegetround (void)
static __inline int fesetround (int __round)
static __inline int fegetenv (fenv_t *__envp)
static __inline int feholdexcept (fenv_t *__envp)
static __inline int fesetenv (const fenv_t *__envp)
static __inline int feupdateenv (const fenv_t *__envp)

Variables

__BEGIN_DECLS const fenv_t npy__fe_dfl_env

Define Documentation

#define __fldcw (   __cw)    __asm __volatile("fldcw %0" : : "m" (__cw))

Referenced by feupdateenv().

#define __fldenv (   __env)    __asm __volatile("fldenv %0" : : "m" (__env))

Referenced by fegetexceptflag(), and feholdexcept().

#define __fnclex ( )    __asm __volatile("fnclex")
#define __fnstcw (   __cw)    __asm __volatile("fnstcw %0" : "=m" (*(__cw)))
#define __fnstenv (   __env)    __asm __volatile("fnstenv %0" : "=m" (*(__env)))

Referenced by fegetexceptflag().

#define __fnstsw (   __sw)    __asm __volatile("fnstsw %0" : "=am" (*(__sw)))

Referenced by feraiseexcept().

#define __fwait ( )    __asm __volatile("fwait")
#define _ROUND_MASK
Value:

Referenced by fegetround(), and fetestexcept().

#define FE_ALL_EXCEPT
Value:

Referenced by feupdateenv().

#define FE_DENORMAL   0x02
#define FE_DFL_ENV   (&npy__fe_dfl_env)
#define FE_DIVBYZERO   0x04
#define FE_DOWNWARD   0x0400
#define FE_INEXACT   0x20
#define FE_INVALID   0x01
Exception flags
#define FE_OVERFLOW   0x08
#define FE_TONEAREST   0x0000
Rounding modes
#define FE_TOWARDZERO   0x0c00
#define FE_UNDERFLOW   0x10
#define FE_UPWARD   0x0800

Typedef Documentation

typedef __uint16_t fexcept_t

Function Documentation

static __inline int feclearexcept ( int  __excepts) [static]
static __inline int fegetenv ( fenv_t __envp) [static]
fnstenv masks all exceptions, so we need to save and restore the control word to avoid this side effect.
static __inline int fegetexceptflag ( fexcept_t __flagp,
int  __excepts 
) [static]

References __fldenv, __fnstenv, and fenv_t::__status.

static __inline int fegetround ( void  ) [static]

References __fnstcw, and _ROUND_MASK.

static __inline int feholdexcept ( fenv_t __envp) [static]

References __fldenv.

static __inline int feraiseexcept ( int  __excepts) [static]

References __fnstsw.

static __inline int fesetenv ( const fenv_t __envp) [static]
static __inline int fesetexceptflag ( const fexcept_t __flagp,
int  __excepts 
) [static]
static __inline int fesetround ( int  __round) [static]
static __inline int fetestexcept ( int  __excepts) [static]

References __fnstcw, and _ROUND_MASK.

static __inline int feupdateenv ( const fenv_t __envp) [static]
__BSD_VISIBLE

References __fldcw, __fnstcw, and FE_ALL_EXCEPT.


Variable Documentation

__BEGIN_DECLS const fenv_t npy__fe_dfl_env
Default floating-point environment