Constants
The header scistats/math/constants.h
defines a number of useful constants as constexpr
functions:
Function | Description | Approximate Value |
---|---|---|
pi | The constant pi | 3.14159 |
epsilon(scale) | A tiny tiny number for a given scale and type | epsilon(1.) = 2.22045e-16 |
inf | The number representing infinity | inf |
min | Smallest number | 2.22507e-308 |
max | Largest number | 1.79769e+308 |
NaN | The number representing “not a number” | nan |
e | Euler’s number - The base of exponentials | 2.71828 |
euler | Euler–Mascheroni constant / or Euler’s gamma : The base of the natural logarithm | 0.577216 |
log2_e | The base-2 logarithm of e | 1.4427 |
log10_e | The base-10 logarithm of e | 0.434294 |
sqrt2 | The square root of two | 1.41421 |
sqrt1_2 | The square root of one-half | 0.707107 |
sqrt3 | The square root of three | 1.73205 |
pi_2 | Pi divided by two | 1.5708 |
pi_4 | Pi divided by four | 0.785398 |
sqrt_pi | The square root of pi | 1.77245 |
two_sqrt_pi | Two divided by the square root of pi | 1.12838 |
one_by_pi | The reciprocal of pi (1./pi) | 0.31831 |
two_by_pi | Twice the reciprocal of pi | 0.63662 |
ln10 | The natural logarithm of ten | 2.30259 |
ln2 | The natural logarithm of two | 0.693147 |
lnpi | The natural logarithm of pi | 1.14473 |