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

◆ exp2_horner() [1/2]

template<typename Derived, int IntBits, int FracBits>
template<typename PolyType>
static FASTLED_FORCE_INLINE Derived fl::fixed_point_base< Derived, IntBits, FracBits >::exp2_horner ( raw_type int_pow,
PolyType fr_ifrac,
PolyType d0,
PolyType d1,
PolyType d2,
PolyType d3,
fl::false_type  )
inlinestaticprivate

Definition at line 458 of file base.h.

460 {
461 constexpr int IFRAC = traits::IFRAC;
462 constexpr PolyType one_ifrac = static_cast<PolyType>(1) << IFRAC;
463 PolyType acc = d3;
464 acc = d2 + ((acc * fr_ifrac) >> IFRAC);
465 acc = d1 + ((acc * fr_ifrac) >> IFRAC);
466 acc = d0 + ((acc * fr_ifrac) >> IFRAC);
470 return Derived::from_raw(static_cast<raw_type>(result));
471 }
typename traits::intermediate_type intermediate_type
Definition base.h:33
static constexpr int FRAC_BITS
Definition base.h:38
typename traits::raw_type raw_type
Definition base.h:31
static constexpr int IFRAC
Definition traits.h:120

References FASTLED_FORCE_INLINE, FRAC_BITS, and fl::fixed_point_traits< IntBits, FracBits >::IFRAC.