Doxygen
1.9.1
|
Files | |
file | tsgMathUtils.hpp |
Math functions and constants. | |
Functions | |
int | TasGrid::Maths::intlog2 (int i) |
Computes std::floor(std::log2(i)), but uses only integer operations. | |
int | TasGrid::Maths::int2log2 (int i) |
Computes std::pow(2, std::floor(std::log2(i))), but uses only integer operations. | |
int | TasGrid::Maths::int3log3 (int i) |
Computes std::pow(3, std::floor(std::log(i) / std::log(2))), but uses only integer operations. | |
int | TasGrid::Maths::pow2 (int p) |
Computes std::pow(2, p), but uses only integer operations. | |
int | TasGrid::Maths::pow3 (int p) |
Computes std::pow(3, p), but uses only integer operations. | |
double | TasGrid::Maths::sign (double p) |
Returns +1 or -1 with the same sign as p. | |
Variables | |
constexpr double | TasGrid::Maths::pi = 3.14159265358979323846 |
Half-period of the std::sin() and std::cos() functions. More... | |
constexpr double | TasGrid::Maths::num_tol = 1.E-12 |
Numerical tolerance for various algorithms. More... | |
|
constexpr |
Half-period of the std::sin() and std::cos() functions.
Borrowed from "math.h", let's hope they don't change the value in a future standard.
|
constexpr |
Numerical tolerance for various algorithms.
num_tol is used in many places: