FastLED 3.9.15
Loading...
Searching...
No Matches

◆ log2_with_msb()

i32 fl::detail::gamma_constexpr::log2_with_msb ( u32 val,
int msb )
constexpr

Definition at line 101 of file gamma_lut.h.

101 {
102 // Use multiplication instead of left-shift to avoid UB when (msb - FRAC)
103 // is negative (left-shifting a negative value is undefined in C++).
104 return static_cast<i32>(
105 static_cast<i64>(msb - FRAC) * static_cast<i64>(1LL << FRAC) +
106 log2_h0(static_cast<i64>(log2_t(val, msb)))
107 );
108}
constexpr u32 log2_t(u32 val, int msb) FL_NOEXCEPT
Definition gamma_lut.h:80
constexpr i64 log2_h0(i64 t) FL_NOEXCEPT
Definition gamma_lut.h:97
fl::i64 i64
Definition s16x16x4.h:222

References FL_NOEXCEPT, FRAC, log2_h0(), and log2_t().

Referenced by log2_fp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: