10.5. Data Definitions for libm

This section defines global identifiers and their values that are associated with interfaces contained in libm. These definitions are organized into groups that correspond to system headers. This convention is used as a convenience for the reader, and does not imply the existence of these headers, or their content. Where an interface is defined as requiring a particular system header file all of the data definitions for that system header file presented here shall be in effect.

This section gives data definitions to promote binary application portability, not to repeat source interface definitions available elsewhere. System providers and application developers should use this ABI to supplement - not to replace - source interface definition specifications.

This specification uses the ISO C (1999) C Language as the reference programming language, and data definitions are specified in ISO C format. The C language is used here as a convenient notation. Using a C language description of these data objects does not preclude their use by other programming languages.

10.5.1. complex.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

10.5.2. fenv.h


#define FE_INEXACT	0x08
#define FE_UNDERFLOW	0x10
#define FE_OVERFLOW	0x20
#define FE_DIVBYZERO	0x40
#define FE_INVALID	0x80

#define FE_ALL_EXCEPT	\
	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)

#define FE_TONEAREST	0
#define FE_TOWARDZERO	0x1
#define FE_UPWARD	0x2
#define FE_DOWNWARD	0x3

typedef unsigned int fexcept_t;

typedef struct {
    fexcept_t fpc;
    void *ieee_instruction_pointer;
} fenv_t;

#define FE_DFL_ENV	((const fenv_t *) -1)

10.5.3. math.h


typedef double float_t;
typedef double double_t;

#define isfinite(x)	\
  (sizeof (x) == sizeof (float) ? __finitef (x) : sizeof (x) == sizeof (double)? __finite (x) : __finitel (x))	/* Return nonzero value if X is not +-Inf or NaN. */
#define fpclassify(x)	\
  (sizeof (x) == sizeof (float) ? __fpclassifyf (x) :sizeof (x) == sizeof (double) ? __fpclassify (x) : __fpclassifyl (x))	/* Return number of classification appropriate for X. */
#define isinf(x)	\
  (sizeof (x) == sizeof (float) ? __isnanf (x)  : sizeof (x) == sizeof (double) ? __isnan (x) : __isnanl (x))
#define isnan(x)	\
  (sizeof (x) == sizeof (float) ? __isnanf (x)  : sizeof (x) == sizeof (double) ? __isnan (x) : __isnanl (x))
#define signbit(x)	\
  (sizeof (x) == sizeof (float)? __signbitf (x): sizeof (x) == sizeof (double)? __signbit (x) : __signbitl (x)	/* Return nonzero value if sign of X is negative. */

#define HUGE_VALL	0x1.0p2047L

#define FP_ILOGB0	-2147483647
#define FP_ILOGBNAN	2147483647

extern int __fpclassifyl(long double);
extern int __signbitl(long double);
extern long double exp2l(long double);