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

◆ pow()

static FASTLED_FORCE_INLINE u8x8 fl::u8x8::pow ( u8x8 base,
u8x8 exp )
inlinestatic

Definition at line 175 of file u8x8.h.

175 {
176 if (base.mValue == 0) return u8x8();
177 constexpr u8x8 one(1.0f);
178 if (exp.mValue == 0) return one;
179 if (base == one) return one;
180 // Snap base values within ~2 ULPs of 1.0 to exactly 1.0 to dodge the
181 // log2(1+t) minimax polynomial's upper-endpoint residual (#2969).
182 constexpr u16 kOneRaw = static_cast<u16>(SCALE);
183 if (base.mValue >= static_cast<u16>(kOneRaw - 2) &&
184 base.mValue <= kOneRaw) {
185 return one;
186 }
187 return exp2_fp(exp * log2_fp(base));
188 }
static FASTLED_FORCE_INLINE u8x8 exp2_fp(u8x8 x) FL_NOEXCEPT
Definition u8x8.h:251
static constexpr i32 SCALE
Definition u8x8.h:23
static FASTLED_FORCE_INLINE u8x8 log2_fp(u8x8 x) FL_NOEXCEPT
Definition u8x8.h:211
constexpr u8x8() FL_NOEXCEPT=default
enable_if< is_fixed_point< T >::value, T >::type exp(T x) FL_NOEXCEPT

References u8x8(), fl::exp(), exp2_fp(), FASTLED_FORCE_INLINE, FL_NOEXCEPT, log2_fp(), and SCALE.

+ Here is the call graph for this function: