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

◆ exp2_horner() [2/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::true_type  )
inlinestaticprivate

Definition at line 441 of file base.h.

443 {
444 constexpr int IFRAC = traits::IFRAC;
445 constexpr PolyType one_ifrac = static_cast<PolyType>(1) << IFRAC;
446 PolyType acc = d3;
447 acc = d2 + static_cast<PolyType>((static_cast<i64>(acc) * fr_ifrac) >> IFRAC);
448 acc = d1 + static_cast<PolyType>((static_cast<i64>(acc) * fr_ifrac) >> IFRAC);
449 acc = d0 + static_cast<PolyType>((static_cast<i64>(acc) * fr_ifrac) >> IFRAC);
450 PolyType frac_pow_ifrac = one_ifrac + static_cast<PolyType>((static_cast<i64>(acc) * fr_ifrac) >> IFRAC);
453 return Derived::from_raw(static_cast<raw_type>(result));
454 }
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.

Referenced by exp2_fp().

+ Here is the caller graph for this function: