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.
This commit is contained in:
parent
8c1817f755
commit
7d69a5ba50
3 changed files with 8 additions and 3 deletions
|
|
@ -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") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue