345 {
351 i32 int_pow;
352 if (n >= 0) {
353 int_pow =
static_cast<i32
>(
SCALE) << n;
354 } else {
355 int_pow =
static_cast<i32
>(
SCALE) >> (-n);
356 }
357
358
359 constexpr int IFRAC = 12;
360 constexpr i32 d0 = 2839;
361 constexpr i32 d1 = 986;
362 constexpr i32 d2 = 219;
363 constexpr i32 d3 = 52;
364
365 i32 fr12 =
static_cast<i32
>(fr.mValue) << (IFRAC -
FRAC_BITS);
366
367 i32 acc = d3;
368 acc = d2 + ((acc * fr12) >> IFRAC);
369 acc = d1 + ((acc * fr12) >> IFRAC);
370 acc = d0 + ((acc * fr12) >> IFRAC);
371 constexpr i32 one12 = 1 << IFRAC;
372 i32 frac_pow12 = one12 + ((acc * fr12) >> IFRAC);
373
374 i32 frac_pow4 = frac_pow12 >> (IFRAC -
FRAC_BITS);
378 }
static constexpr int FRAC_BITS
static constexpr int INT_BITS
constexpr FASTLED_FORCE_INLINE s12x4 floor() const FL_NOEXCEPT
static constexpr i32 SCALE
constexpr s12x4() FL_NOEXCEPT=default
static constexpr FASTLED_FORCE_INLINE s12x4 from_raw(i16 raw) FL_NOEXCEPT
expected< T, E > result
Alias for expected (Rust-style naming)