Merge pull request #81464 from AcatXIo/fix-sign-nan

Fix `SIGN(NAN)` returning 1
This commit is contained in:
Rémi Verschelde 2023-09-12 12:01:39 +02:00
commit 38ca83e16f
No known key found for this signature in database
GPG key ID: C3336907360768E1
3 changed files with 8 additions and 3 deletions

View file

@ -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") {