| 716 | |
| 717 | template<typename T> |
| 718 | void test_pow_basic_impl(float pow_x_0_5_max, float pow_x_2_0_max) { |
| 719 | // 2^2 = 4 (safe for all types) |
| 720 | FL_CHECK_CLOSE(T::pow(T(2.0f), T(2.0f)).to_float(), 4.0f, pow_x_2_0_max); |
| 721 | |
| 722 | // 4^0.5 = 2 (sqrt via pow) |
| 723 | FL_CHECK_CLOSE(T::pow(T(4.0f), T(0.5f)).to_float(), 2.0f, pow_x_0_5_max); |
| 724 | |
| 725 | // x^0 = 1 |
| 726 | FL_CHECK_CLOSE(T::pow(T(5.0f), T(0.0f)).to_float(), 1.0f, pow_x_2_0_max); |
| 727 | |
| 728 | // 0^x = 0 |
| 729 | FL_CHECK_EQ(T::pow(T(), T(2.0f)).raw(), raw_t<T>(0)); |
| 730 | |
| 731 | // negative base = 0 |
| 732 | FL_CHECK_EQ(T::pow(T(-1.0f), T(2.0f)).raw(), raw_t<T>(0)); |
| 733 | } |
| 734 | |
| 735 | template<typename T> |
| 736 | void test_pow_extended_impl(float pow_x_3_0_max) { |