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

◆ pow()

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

Definition at line 169 of file u8x24.h.

169 {
170 if (base.mValue == 0) return u8x24();
171 constexpr u8x24 one(1.0f);
172 if (exp.mValue == 0) return one;
173 if (base == one) return one;
174 // Snap base values within ~2 ULPs of 1.0 to exactly 1.0 to dodge the
175 // log2(1+t) minimax polynomial's upper-endpoint residual (#2969).
176 constexpr u32 kOneRaw = static_cast<u32>(SCALE);
177 if (base.mValue >= (kOneRaw - 2u) && base.mValue <= kOneRaw) {
178 return one;
179 }
180 return exp2_fp(exp * log2_fp(base));
181 }
constexpr u8x24() FL_NOEXCEPT=default
static FASTLED_FORCE_INLINE u8x24 exp2_fp(u8x24 x) FL_NOEXCEPT
Definition u8x24.h:236
static FASTLED_FORCE_INLINE u8x24 log2_fp(u8x24 x) FL_NOEXCEPT
Definition u8x24.h:202
static constexpr i32 SCALE
Definition u8x24.h:23
enable_if< is_fixed_point< T >::value, T >::type exp(T x) FL_NOEXCEPT

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

+ Here is the call graph for this function: