summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2023-05-12 15:08:03 +0200
committerGitHub <noreply@github.com>2023-05-12 15:08:03 +0200
commit2ac4e3bb30517998916bb6b81b7b76788276038c (patch)
tree245bf4614ff38f3b0fcac813c1dde8c39b57732d /tests
parentfdf66b3472e5ca254a4f90c32f26c4702d46828b (diff)
parentfa8b32cbd4503e73a840bd1a1dd32d2a88cc3f45 (diff)
Merge pull request #76998 from akien-mga/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.3) - 4th batch
Diffstat (limited to 'tests')
-rw-r--r--tests/core/math/test_math_funcs.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/core/math/test_math_funcs.h b/tests/core/math/test_math_funcs.h
index 3e587390f8..b6cb9620f1 100644
--- a/tests/core/math/test_math_funcs.h
+++ b/tests/core/math/test_math_funcs.h
@@ -157,15 +157,15 @@ TEST_CASE_TEMPLATE("[Math] asin/acos/atan", T, float, double) {
CHECK(Math::asin((T)0.1) == doctest::Approx((T)0.1001674212));
CHECK(Math::asin((T)0.5) == doctest::Approx((T)0.5235987756));
CHECK(Math::asin((T)1.0) == doctest::Approx((T)1.5707963268));
- CHECK(Math::is_nan(Math::asin((T)1.5)));
- CHECK(Math::is_nan(Math::asin((T)450.0)));
+ CHECK(Math::asin((T)2.0) == doctest::Approx((T)1.5707963268));
+ CHECK(Math::asin((T)-2.0) == doctest::Approx((T)-1.5707963268));
CHECK(Math::acos((T)-0.1) == doctest::Approx((T)1.670963748));
CHECK(Math::acos((T)0.1) == doctest::Approx((T)1.4706289056));
CHECK(Math::acos((T)0.5) == doctest::Approx((T)1.0471975512));
CHECK(Math::acos((T)1.0) == doctest::Approx((T)0.0));
- CHECK(Math::is_nan(Math::acos((T)1.5)));
- CHECK(Math::is_nan(Math::acos((T)450.0)));
+ CHECK(Math::acos((T)2.0) == doctest::Approx((T)0.0));
+ CHECK(Math::acos((T)-2.0) == doctest::Approx((T)Math_PI));
CHECK(Math::atan((T)-0.1) == doctest::Approx((T)-0.0996686525));
CHECK(Math::atan((T)0.1) == doctest::Approx((T)0.0996686525));
@@ -472,7 +472,7 @@ TEST_CASE_TEMPLATE("[Math] wrapf", T, float, double) {
CHECK(Math::wrapf(300'000'000'000.0, -20.0, 160.0) == doctest::Approx((T)120.0));
// float's precision is too low for 300'000'000'000.0, so we reduce it by a factor of 1000.
- CHECK(Math::wrapf((float)300'000'000.0, (float)-20.0, (float)160.0) == doctest::Approx((T)128.0));
+ CHECK(Math::wrapf((float)15'000'000.0, (float)-20.0, (float)160.0) == doctest::Approx((T)60.0));
}
TEST_CASE_TEMPLATE("[Math] fract", T, float, double) {