Browse Source

fix a test for wrapf with signed 32-bit float

ajreckof 2 years ago
parent
commit
fabd9535f0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tests/core/math/test_math_funcs.h

+ 1 - 1
tests/core/math/test_math_funcs.h

@@ -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));
 	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.
 	// 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) {
 TEST_CASE_TEMPLATE("[Math] fract", T, float, double) {