M_PI(3) Library Functions Manual M_PI(3)

constantsmathematical library constants

#include <math.h>

The header file math.h provides macros that define a number of useful numerical constants.

As required by the POSIX standard, these constants are double-precision literals, with enough digits specified as to ensure that they are correctly rounded in double-precision:

M_E

"Euler's constant" or e; the base of the natural logarithm.

M_LOG2E
M_LOG10E

The logarithms of e in base 2 and 10, respectively.

M_LN2
M_LN10

The natural logarithms of 2 and 10, respectively. Note that these are the reciprocals of the preceding two values.

M_PI
M_PI_2
M_PI_4

pi, pi/2, and pi/4, respectively.

M_1_PI
M_2_PI

1/pi and 2/pi, respectively.

M_2_SQRTPI

Two divided by the square root of pi.

M_SQRT2
M_SQRT_1_2

The square root of two and its reciprocal, respectively.

math(3), float(3),

The <math.h> functions and macros conform to the ISO/IEC 9899:2011 standard.

July 6, 2010 macOS 15.2