MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_pow_one_ulp_below_one_impl

Function test_pow_one_ulp_below_one_impl

tests/fl/math/fixed_point.cpp:5160–5167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5158// the snap, this must collapse to exactly one.
5159template <typename FP>
5160static void test_pow_one_ulp_below_one_impl() {
5161 const FP just_below = FP::from_raw(static_cast<raw_t<FP>>(FP::SCALE - 1));
5162 const FP one(1.0f);
5163 const FP gamma_2_8(2.8f);
5164 const FP gamma_3_2(3.2f);
5165 FL_CHECK_EQ(FP::pow(just_below, gamma_2_8).raw(), one.raw());
5166 FL_CHECK_EQ(FP::pow(just_below, gamma_3_2).raw(), one.raw());
5167}
5168
5169// Same as above, two LSBs below 1.0 -- also inside the snap window.
5170template <typename FP>

Callers

nothing calls this directly

Calls 2

powFunction · 0.50
rawMethod · 0.45

Tested by

no test coverage detected