DISTRHO Plugin Framework
Functions
Math related functions

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 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)
 

Detailed Description

Function Documentation

◆ d_isEqual()

template<typename T >
static constexpr bool d_isEqual ( const T &  v1,
const T &  v2 
)
inlinestaticconstexpr

Safely compare two floating point numbers. Returns true if they match.

◆ d_isNotEqual()

template<typename T >
static constexpr bool d_isNotEqual ( const T &  v1,
const T &  v2 
)
inlinestaticconstexpr

Safely compare two floating point numbers. Returns true if they don't match.

◆ d_isZero()

template<typename T >
static constexpr bool d_isZero ( const T &  value)
inlinestaticconstexpr

Safely check if a floating point number is zero.

◆ d_isNotZero()

template<typename T >
static constexpr bool d_isNotZero ( const T &  value)
inlinestaticconstexpr

Safely check if a floating point number is not zero.

◆ d_nextPowerOf2()

static uint32_t d_nextPowerOf2 ( uint32_t  size)
inlinestaticnoexcept

Get next power of 2.

◆ d_roundToIntPositive()

template<typename T >
static constexpr int32_t d_roundToIntPositive ( const T &  value)
inlinestaticconstexpr

Round a floating point number to an integer. Fast operation for values known to be 0 or positive.

◆ d_roundToUnsignedInt()

template<typename T >
static constexpr uint32_t d_roundToUnsignedInt ( const T &  value)
inlinestaticconstexpr

Round a floating point number to an unsigned integer. Fast operation for values known to be 0 or positive.

◆ d_roundToIntNegative()

template<typename T >
static constexpr int32_t d_roundToIntNegative ( const T &  value)
inlinestaticconstexpr

Round a floating point number to an integer. Fast operation for values known to be 0 or negative.

◆ d_roundToInt()

template<typename T >
static constexpr int32_t d_roundToInt ( const T &  value)
inlinestaticconstexpr

Round a floating point number to integer.