375 {
381 i32 int_pow;
382 if (n >= 0) {
383 int_pow =
static_cast<i32
>(
SCALE) << n;
384 } else {
385 int_pow =
static_cast<i32
>(
SCALE) >> (-n);
386 }
387
388
389 constexpr int IFRAC = 24;
390 constexpr i64 d0 = 11629376LL;
391 constexpr i64 d1 = 4038400LL;
392 constexpr i64 d2 = 895232LL;
393 constexpr i64 d3 = 214016LL;
394
396
398 acc = d2 + ((acc * fr24) >> IFRAC);
399 acc = d1 + ((acc * fr24) >> IFRAC);
400 acc = d0 + ((acc * fr24) >> IFRAC);
401 constexpr i64 one24 = 1LL << IFRAC;
402 i64 frac_pow24 = one24 + ((acc * fr24) >> IFRAC);
403
404 i32 frac_pow16 =
static_cast<i32
>(frac_pow24 >> (IFRAC -
FRAC_BITS));
408 }
static constexpr i32 SCALE
constexpr FASTLED_FORCE_INLINE s16x16 floor() const FL_NOEXCEPT
static constexpr int INT_BITS
constexpr s16x16() FL_NOEXCEPT=default
static constexpr int FRAC_BITS
static constexpr FASTLED_FORCE_INLINE s16x16 from_raw(i32 raw) FL_NOEXCEPT
expected< T, E > result
Alias for expected (Rust-style naming)