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

Function test_sincos_impl

tests/fl/math/fixed_point.cpp:652–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650
651template<typename T>
652void test_sincos_impl(float sin_max, float cos_max) {
653 T angle(0.7854f); // ~pi/4
654 T s, c;
655 T::sincos(angle, s, c);
656
657 FL_CHECK_CLOSE(s.to_float(), 0.7071f, sin_max);
658 FL_CHECK_CLOSE(c.to_float(), 0.7071f, cos_max);
659
660 // sincos must match individual sin/cos
661 FL_CHECK_EQ(s.raw(), T::sin(angle).raw());
662 FL_CHECK_EQ(c.raw(), T::cos(angle).raw());
663}
664
665template<typename T>
666void test_atan_impl(float atan_max) {

Callers

nothing calls this directly

Calls 5

sincosFunction · 0.50
sinFunction · 0.50
cosFunction · 0.50
to_floatMethod · 0.45
rawMethod · 0.45

Tested by

no test coverage detected