constants.hpp

Commonly used constant values. Status: RELEASE.

Functions

template<typename T>
constexpr T MaxValue()

Determine the maximum value for any type.

template<typename T>
constexpr double InterpolateTable(T &&table, double pos, double tsize)

The following function takes a table and a position [0.0, 1.0) and intepolates a value.

Variables

constexpr const double E = 2.71828

e

constexpr const double PHI = 1.61803398874

Golden ratio.

constexpr const double PI = 3.14159265358979

pi

constexpr const double SQRT2 = 1.41421356237310

sqrt(2)

constexpr const uint32_t MAX_BYTE = 255

(2^8 - 1)

constexpr const uint32_t MAX_2BYTE = 65535

(2^16 - 1)

constexpr const uint32_t MAX_WORD = 65535

(2^16 - 1)

constexpr const uint32_t MAX_3BYTE = 16777215

(2^24 - 1)

constexpr const uint32_t MAX_UINT = 4294967295

(2^32 - 1)

constexpr const uint32_t MAX_4BYTE = 4294967295

(2^32 - 1)

constexpr const int32_t MIN_INT = -2147483648

(- 2^31)

constexpr const size_t MAX_SIZE_T = static_cast<size_t>(-1)
constexpr const double log2_chart_1_2[]

Large table to log base-2 results.

constexpr const double pow2_chart_bits[] = {1.4142135623730951, 1.1892071150027210, 1.0905077326652577, 1.0442737824274138, 1.0218971486541166, 1.0108892860517005, 1.0054299011128027, 1.0027112750502025, 1.0013547198921082, 1.0006771306930664, 1.0003385080526823, 1.0001692397053021, 1.0000846162726944, 1.0000423072413958, 1.0000211533969647, 1.0000105766425498, 1.0000052883072919, 1.0000026441501502, 1.0000013220742012, 1.0000006610368821, 1.0000003305183864, 1.0000001652591795, 1.0000000826295863, 1.0000000413147923, 1.0000000206573960, 1.0000000103286979, 1.0000000051643489, 1.0000000025821745, 1.0000000012910872, 1.0000000006455436, 1.0000000003227718, 1.0000000001613858}

Table to provide results of Pow2 for values of bits (0.1, 0.01, 0.001, etc, in binary)

constexpr const double pow2_chart_0_1[]

Table to provide results of Pow2 from 0 to 1.