7.3. constants — Mathematical constants

This module contains some common mathematical constants, implement as constexpr double variables.

7.3.1. Standard POSIX constants

If the standard POSIX mathematical constants are defined as macros, this modules undefines them. These constant are reintroduced in the namespace polder::math, no matter whether they were already defined as macros.

constexpr double math::M_E

Value of \(e\).

constexpr double math::M_LOG2E

Value of \(\log_2{e}\).

constexpr double math::M_LOG10E

Value of \(\log_{10}{e}\).

constexpr double math::M_LN2

Value of \(\ln{2}\).

constexpr double math::M_LN10

Value of \(\ln{10}\).

constexpr double math::M_PI

Value of \(\pi\).

constexpr double math::M_PI_2

Value of \(\pi/2\).

constexpr double math::M_PI_4

Value of \(\pi/4\).

constexpr double math::M_1_PI

Value of \(1/\pi\).

constexpr double math::M_2_PI

Value of \(2/\pi\).

constexpr double math::M_2_SQRTPI

Value of \(2/\sqrt{\pi}\).

constexpr double math::M_SQRT2

Value of \(\sqrt{2}\).

constexpr double math::M_SQRT1_2

Value of \(1/\sqrt{2}\).

7.3.2. Unit circle constants

constexpr double math::M_PI_3

Value of \(\pi/3\).

constexpr double math::M_PI_6

Value of \(\pi/6\).

constexpr double math::M_2PI_3

Value of \(2*\pi/3\).

constexpr double math::M_3PI_4

Value of \(3*\pi/4\).

constexpr double math::M_5PI_6

Value of \(5*\pi/6\).

constexpr double math::M_7PI_6

Value of \(7*\pi/6\).

constexpr double math::M_5PI_4

Value of \(5*\pi/4\).

constexpr double math::M_4PI_3

Value of \(4*\pi/3\).

constexpr double math::M_5PI_3

Value of \(5*\pi/3\).

constexpr double math::M_7PI_4

Value of \(7*\pi/4\).

constexpr double math::M_11PI_6

Value of \(11*\pi/6\).

constexpr double math::M_SQRT2_2

Value of \(\sqrt{2}/2\).

constexpr double math::M_SQRT2_3

Value of \(\sqrt{2}/3\).

7.3.3. Other common constants

constexpr double math::M_PHI

Value of \(\phi\).

constexpr double math::M_SQRT3

Value of \(\sqrt{3}\).

constexpr double math::M_PI_180

Value of \(\pi/180\).

constexpr double math::M_180_PI

Value of \(180/\pi\).

constexpr double math::M_2PI

Value of \(2*\pi\).