1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
4 // Public Domain C Library - http://pdclib.sourceforge.net
5 // This code is Public Domain. Use, modify, and redistribute at will.
6 // ----------------------------------------------------------------------------
7 // Floating-point environment
8 // ----------------------------------------------------------------------------
11 #define __FENV_H __FENV_H
13 // TODO: Documentation, checking for personality
15 // ----------------------------------------------------------------------------
19 #define FE_DIVBYZERO // TODO
20 #define FE_INEXACT // TODO
21 #define FE_INVALID // TODO
22 #define FE_OVERFLOW // TODO
23 #define FE_UNDERFLOW // TODO
24 #define FE_ALL_EXCEPT // TODO
26 #define FE_DOWNWARD // TODO
27 #define FE_TONEAREST // TODO
28 #define FE_TOWARDZERO // TODO
29 #define FE_UPWARD // TODO
31 #define FE_DFL_ENV // TODO
33 // ----------------------------------------------------------------------------
36 typedef fenv_t; // TODO
37 typedef fexcept_t; // TODO
39 // ----------------------------------------------------------------------------
42 int feclearexcept( int exceptions );
43 int fegetexceptflag( fexcept_t * flags, int exceptions );
44 int feraiseexcept( int exceptions );
45 int fesetexceptflag( const fexcept_t * flags, int exceptions );
46 int fetestexcept( int exceptions );
48 int fegetround( void );
49 int fesetround( int mode );
51 int fegetenv( fenv_t * environment );
52 int feholdexcept( fenv_t * environment );
53 int fesetenv( const fenv_t * environment );
54 int feupdateenv( const fenv_t * environment );