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

Function test_abs_sign_impl

tests/fl/math/fixed_point.cpp:602–616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

600
601template<typename T>
602void test_abs_sign_impl() {
603 T pos(3.5f);
604 FL_CHECK_EQ(T::abs(pos).raw(), pos.raw());
605
606 T neg(-3.5f);
607 FL_CHECK_EQ(T::abs(neg).raw(), pos.raw());
608
609 T zero;
610 FL_CHECK_EQ(T::abs(zero).raw(), raw_t<T>(0));
611
612 // sign
613 FL_CHECK_EQ(T::sign(pos), 1);
614 FL_CHECK_EQ(T::sign(neg), -1);
615 FL_CHECK_EQ(T::sign(zero), 0);
616}
617
618// ===========================================================================
619// Transcendental Test Helpers (Template Infrastructure)

Callers

nothing calls this directly

Calls 2

absFunction · 0.50
rawMethod · 0.45

Tested by

no test coverage detected