muldiv.h
Go to the documentation of this file.
93 template <typename ValType> __forceinline ValType muldivMaxValue(ValType timevar, ValType num, ValType den)
110 __forceinline ValType IRAM_ATTR muldiv(const ValType& value, const NumDenType& num, const NumDenType& den)
173 __forceinline uint64_t IRAM_ATTR muldiv64(const uint64_t& value, const uint64_t& num, const uint64_t& den)
186 template <uint64_t num, uint64_t den, typename ValType> __forceinline ValType IRAM_ATTR muldiv(const ValType& value)
ValType muldivMaxValue(ValType timevar, ValType num, ValType den)
Get the maximum value which can be passed to muldiv() without overflowing.
Definition: muldiv.h:93
ValType muldiv(const ValType &value, const NumDenType &num, const NumDenType &den)
Perform muldiv using unsigned integer types.
Definition: muldiv.h:110
uint64_t muldiv64(const uint64_t &value, const uint64_t &num, const uint64_t &den)
Perform muldiv using 64-bit values.
Definition: muldiv.h:173
uint32_t muldiv32(uint32_t value, uint32_t num, uint32_t den)
Perform muldiv using 32-bit values.
Definition: muldiv.h:160
static constexpr ValType maxValue()
Get the maximum value which can be used for a muldiv calculation without overflowing.
Definition: muldiv.h:75
static constexpr ValType overflow()
Get the value representing overflow for the given ValType.
Definition: muldiv.h:66