math contains declarations of the functions in the
Development System Math Library
and the C Library
that return floating-point values.
math also defines the structures and constants used by the
matherr(S)
error-handling mechanisms, including
the following constant used as an error-return value:
HUGE
maximum value of a single-precision floating-point number
The following mathematical constants are defined:
M_E
base of natural logarithms (e)
M_LOG2E
base-2 logarithm of e
M_LOG10E
base-10 logarithm of e
M_LN2
natural logarithm of 2
M_LN10
natural logarithm of 10
M_PI
π,
the ratio of the circumference of a circle to its diameter
M_PI_2
π/2
M_PI_4
π/4
M_1_PI
1/π
M_2_PI
2/π
M_2_SQRTPI
2/√π
M_SQRT2
positive square root of 2
M_SQRT1_2
positive square root of ½
Limitations
Machine-dependent constants are defined in the <values.h> header file
(see
values(M)
).
ISO/IEC 9945-1:1990, Information technology - Portable Operating System Interface (POSIX) - Part 1: System Application Program Interface (API) [C Language] (IEEE Std 1003.1-1990);
X/Open CAE Specification, System Interfaces and Headers, Issue 4, 1992.