Namespace for math operations. More...
Classes | |
struct | Pow |
Template meta programming for pow(a, b) where a, b must be natural numbers Use Pow<a, b>::result = a^b, which is computed in compilation rather than runtime. More... | |
struct | Pow< B, 0 > |
Functions | |
template<class T > | |
const T | clip (const T &value, const T &low, const T &high) |
Clip values in-between low and high values. More... | |
int | round (double value) |
fast round utilizing hardware acceleration features More... | |
Detailed Description
Namespace for math operations.
Function Documentation
template<class T >
|
inline |
Clip values in-between low and high values.
- Parameters
-
value The value to be clipped low The lower bound high The higher bound
- Returns
- Value if value in[low, high] or low if (value < low) or high if (value > high)
- Note
- Foolproof if low/high are not set correctly
|
inline |
fast round utilizing hardware acceleration features
- Parameters
-
value
- Returns
- Rounded int