<QtMath> - Generic Math Functions
The <QtMath> header file provides various math functions. More...
These functions are partly convenience definitions for basic math operations not available in the C or Standard Template Libraries.
The header also ensures some constants specified in POSIX, but not present in C++ standards (so absent from <math.h> on some platforms), are defined:
Constant | Description |
---|---|
M_E | The base of the natural logarithms, e = exp(1) |
M_LOG2E | The base-two logarithm of e |
M_LOG10E | The base-ten logarithm of e |
M_LN2 | The natural logarithm of two |
M_LN10 | The natural logarithm of ten |
M_PI | The ratio of a circle's circumference to diameter, π |
M_PI_2 | Half M_PI, π / 2 |
M_PI_4 | Quarter M_PI, π / 4 |
M_1_PI | The inverse of M_PI, 1 / π |
M_2_PI | Twice the inverse of M_PI, 2 / π |
M_2_SQRTPI | Two divided by the square root of pi, 2 / √π |
M_SQRT2 | The square root of two, √2 |
M_SQRT1_2 | The square roof of half, 1 / √2 |