|
template<typename T > |
constexpr T | Clamp (const T val, const T min, const T max) |
| Clamp value in range.
|
|
template<typename T > |
constexpr T | DegToRad (T degrees) |
| Convert degrees to radians.
|
|
template<typename T > |
constexpr T | RadToDeg (T radians) |
| Convert radians to degrees.
|
|
double | RoundToFracDigits (const double value, const int digits) |
| Round to desired number of fractional digits (of precision)
|
|
|
Examples:
uint8_t mask = 0;
const bool bit_7_is_set = CheckBits(mask, Bit(7));
void SetBits(T &mask, const T bits) Sets the bits.
constexpr T Bit(const size_t bit) Return a number with the given bit set to 1 (i.e. 2^bit)
|
template<typename T > |
constexpr T | Bit (const size_t bit) |
| Return a number with the given bit set to 1 (i.e. 2^bit)
|
|
template<typename T > |
constexpr bool | CheckBitsAll (const T mask, const T bits) |
| Checks if all bits are set.
|
|
template<typename T > |
constexpr bool | CheckBitsAny (const T mask, const T bits) |
| Checks if any bits are set.
|
|
template<typename T > |
constexpr T | GetBits (const T value, const T mask) |
| Extracts bits.
|
|
template<typename T > |
void | SetBits (T &mask, const T bits) |
| Sets the bits.
|
|
template<typename T > |
void | ClearBits (T &mask, const T bits) |
| Clears the bits.
|
|
template<typename T > |
void | ToggleBits (T &mask, const T bits) |
| Toggles the bits.
|
|