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

Function test_sin_impl

tests/fl/math/fixed_point.cpp:625–637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

623
624template<typename T>
625void test_sin_impl(float sin_max) {
626 T zero;
627 FL_CHECK_CLOSE(T::sin(zero).to_float(), 0.0f, sin_max);
628
629 T half_pi(1.5707963f);
630 FL_CHECK_CLOSE(T::sin(half_pi).to_float(), 1.0f, sin_max);
631
632 T pi(3.1415926f);
633 FL_CHECK_CLOSE(T::sin(pi).to_float(), 0.0f, sin_max);
634
635 T neg_half_pi(-1.5707963f);
636 FL_CHECK_CLOSE(T::sin(neg_half_pi).to_float(), -1.0f, sin_max);
637}
638
639template<typename T>
640void test_cos_impl(float cos_max) {

Callers

nothing calls this directly

Calls 2

sinFunction · 0.50
to_floatMethod · 0.45

Tested by

no test coverage detected