Predefined Constants
There exists some pre-defined constants in the fixed_num class, and the names of these functions are listed below.
epsilon: the epsilon of current fixed number.
e: natural constant.
pi: π.
pi_2: π/2.
Numbers Header File
The header file eirin/numbers.hpp contains the constants which same as the standard library <numbers> header file.
They are defined in the
numbersnamespace.To be noticed that, the accuracy of these constants are based on 64-bit fixed point numbers.
And if you want more accuracy for your custom fixed number like
fixed128, you can check and use the auxiliary functions ineirin/detail/util.hpp.The calculation method has been illustrated in the
eirin/detail/util.hppfile.
Name |
Description |
|---|---|
|
The mathematical constant e. |
|
The mathematical constant pi. |
|
The logarithm of e to the base 2. |
|
The logarithm of e to the base 10. |
|
The multiplicative inverse of pi. |
|
The multiplicative inverse of the square root of pi. |
|
The natural logarithm of 2. |
|
The natural logarithm of 10. |
|
The square root of 2. |
|
The square root of 3. |
|
The multiplicative inverse of the square root of 3. |
|
The Euler-Mascheroni constant. |
|
The golden ratio. |