1*27620987Smatt /* $NetBSD: fenv.h,v 1.1 2014/09/03 19:34:26 matt Exp $ */ 2*27620987Smatt 3*27620987Smatt /* 4*27620987Smatt * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995 5*27620987Smatt * Public domain. 6*27620987Smatt */ 7*27620987Smatt 8*27620987Smatt #ifndef _OR1K_FENV_H_ 9*27620987Smatt #define _OR1K_FENV_H_ 10*27620987Smatt 11*27620987Smatt typedef int fenv_t; /* FPSCR */ 12*27620987Smatt typedef int fexcept_t; 13*27620987Smatt 14*27620987Smatt #define FE_OVERFLOW 0x001 /* Result overflowed */ 15*27620987Smatt #define FE_UNDERFLOW 0x002 /* Result underflowed */ 16*27620987Smatt #define FE_SNAN 0x004 /* Result SNaN */ 17*27620987Smatt #define FE_QNAN 0x008 /* Result QNaN */ 18*27620987Smatt #define FE_ZERO 0x010 /* Result zero */ 19*27620987Smatt #define FE_INEXACT 0x020 /* Result inexact */ 20*27620987Smatt #define FE_INVALID 0x040 /* Result invalid */ 21*27620987Smatt #define FE_INFINITY 0x080 /* Result infinite */ 22*27620987Smatt #define FE_DIVBYZERO 0x100 /* divide-by-zero */ 23*27620987Smatt 24*27620987Smatt #define FE_ALL_EXCEPT 0x1ff 25*27620987Smatt 26*27620987Smatt #define FE_TONEAREST 0 /* round to nearest representable number */ 27*27620987Smatt #define FE_TOWARDZERO 1 /* round to zero (truncate) */ 28*27620987Smatt #define FE_UPWARD 2 /* round toward positive infinity */ 29*27620987Smatt #define FE_DOWNWARD 3 /* round toward negative infinity */ 30*27620987Smatt 31*27620987Smatt __BEGIN_DECLS 32*27620987Smatt 33*27620987Smatt /* Default floating-point environment */ 34*27620987Smatt extern const fenv_t __fe_dfl_env; 35*27620987Smatt #define FE_DFL_ENV (&__fe_dfl_env) 36*27620987Smatt 37*27620987Smatt __END_DECLS 38*27620987Smatt 39*27620987Smatt #endif /* _OR1K_FENV_H_ */ 40