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

Function test_pow_exactly_one_impl

tests/fl/math/fixed_point.cpp:5146–5154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5144// thanks to the `base == one` short-circuit, but lock it in.
5145template <typename FP>
5146static void test_pow_exactly_one_impl() {
5147 const FP one(1.0f);
5148 const FP two(2.0f);
5149 const FP gamma_2_8(2.8f);
5150 const FP gamma_3_2(3.2f);
5151 FL_CHECK_EQ(FP::pow(one, two).raw(), one.raw());
5152 FL_CHECK_EQ(FP::pow(one, gamma_2_8).raw(), one.raw());
5153 FL_CHECK_EQ(FP::pow(one, gamma_3_2).raw(), one.raw());
5154}
5155
5156// pow(base, exp) where base.raw() == SCALE - 1 (one ULP below 1.0). Without
5157// the snap, the polynomial gives a value ~50-100 LSB below expected. With

Callers

nothing calls this directly

Calls 2

powFunction · 0.50
rawMethod · 0.45

Tested by

no test coverage detected