diff options
author | AcatXIo <AcatXIo@proton.me> | 2023-09-09 11:30:11 +0200 |
---|---|---|
committer | AcatXIo <AcatXIo@proton.me> | 2023-09-09 11:30:11 +0200 |
commit | 7d69a5ba50369dad5f75c14448f674f86b41c38d (patch) | |
tree | 654f4da4555701d8758a1e17189d608117f77b8a /tests | |
parent | 8c1817f755b63a69378774d8d0f74499f663afe2 (diff) | |
download | redot-engine-7d69a5ba50369dad5f75c14448f674f86b41c38d.tar.gz |
Fix sign(NAN) returning 1.
Fixes #79036. sign(NAN) now returns 0.
This should not impact performance much in any way.
Adds a test for the NAN case. Updates the documentation to clarify the new behavior.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/math/test_math_funcs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/core/math/test_math_funcs.h b/tests/core/math/test_math_funcs.h index e3504ef1e5..d046656b0f 100644 --- a/tests/core/math/test_math_funcs.h +++ b/tests/core/math/test_math_funcs.h @@ -54,6 +54,8 @@ TEST_CASE("[Math] C++ macros") { CHECK(SIGN(-5) == -1.0); CHECK(SIGN(0) == 0.0); CHECK(SIGN(5) == 1.0); + // Check that SIGN(NAN) returns 0.0. + CHECK(SIGN(NAN) == 0.0); } TEST_CASE("[Math] Power of two functions") { |