1.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.

These definitions are intended to supplement those provided in the referenced underlying specifications.

This specification uses ISO/IEC 9899 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.

1.5.1. fenv.h

#define FE_INVALID	0x01
#define FE_DIVBYZERO	0x04
#define FE_OVERFLOW	0x08
#define FE_UNDERFLOW	0x10
#define FE_INEXACT	0x20


#define FE_TONEAREST	0
#define FE_DOWNWARD	0x400
#define FE_UPWARD	0x800
#define FE_TOWARDZERO	0xc00

typedef unsigned short fexcept_t;

typedef struct
  unsigned short __control_word;
  unsigned short __unused1;
  unsigned short __status_word;
  unsigned short __unused2;
  unsigned short __tags;
  unsigned short __unused3;
  unsigned int __eip;
  unsigned short __cs_selector;
  unsigned int __opcode:11;
  unsigned int __unused4:5;
  unsigned int __data_offset;
  unsigned short __data_selector;
  unsigned short __unused5;
#define FE_DFL_ENV	((__const fenv_t *) -1)

1.5.2. math.h

#define fpclassify(x)	(sizeof (x) == sizeof (float) ? __fpclassifyf (x) :sizeof (x) == sizeof (double) ? __fpclassify (x) : __fpclassifyl (x))
#define signbit(x)	(sizeof (x) == sizeof (float)? __signbitf (x): sizeof (x) == sizeof (double)? __signbit (x) : __signbitl (x))

#define FP_ILOGB0	(-2147483647 - 1)
#define FP_ILOGBNAN	(-2147483647 - 1)