|
Dusk Audio Framework
|
Functions | |
| template<typename T> | |
| static constexpr bool | d_isEqual (const T &v1, const T &v2) |
| template<typename T> | |
| static constexpr bool | d_isNotEqual (const T &v1, const T &v2) |
| template<typename T> | |
| static constexpr bool | d_isZero (const T &value) |
| template<typename T> | |
| static constexpr bool | d_isNotZero (const T &value) |
| static bool | d_isFinite (const double value) noexcept |
| static bool | d_isFinite (const float value) noexcept |
| static uint32_t | d_nextPowerOf2 (uint32_t size) noexcept |
| template<typename T> | |
| static constexpr int32_t | d_roundToIntPositive (const T &value) |
| template<typename T> | |
| static constexpr uint32_t | d_roundToUnsignedInt (const T &value) |
| template<typename T> | |
| static constexpr int32_t | d_roundToIntNegative (const T &value) |
| template<typename T> | |
| static constexpr int32_t | d_roundToInt (const T &value) |
|
inlinestaticconstexpr |
Safely compare two floating point numbers. Returns true if they match.
|
inlinestaticconstexpr |
Safely compare two floating point numbers. Returns true if they don't match.
|
inlinestaticconstexpr |
Safely check if a floating point number is zero.
|
inlinestaticconstexpr |
Safely check if a floating point number is not zero.
|
inlinestaticnoexcept |
Check if a floating point number is finite, that is neither infinite nor NaN.
Use this instead of std::isfinite, std::isnan or std::isinf on values from outside your own code, such as parameter values from the host. DAF's Makefile builds compile with -ffast-math, which lets the compiler assume that no value is ever infinite or NaN, and GCC and Clang then fold those checks to a constant: the check is silently compiled out. This reads the bit pattern instead, through a volatile, so neither compiler can apply that assumption to it.
|
inlinestaticnoexcept |
Check if a floating point number is finite, that is neither infinite nor NaN.
|
inlinestaticnoexcept |
Get next power of 2.
|
inlinestaticconstexpr |
Round a floating point number to an integer. Fast operation for values known to be 0 or positive.
|
inlinestaticconstexpr |
Round a floating point number to an unsigned integer. Fast operation for values known to be 0 or positive.
|
inlinestaticconstexpr |
Round a floating point number to an integer. Fast operation for values known to be 0 or negative.
|
inlinestaticconstexpr |
Round a floating point number to integer.