-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-123836: check zero signs in math_testcases.txt #123854
Conversation
Just like cmath_testcases.txt. These tests require IEEE 754 anyway.
This comment was marked as outdated.
This comment was marked as outdated.
CC @picnixz |
Sorry Sergey for not replying to your pings. I see them but I'm either doing something else or then I forget about them :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merged, thanks. |
Thanks @skirpichev for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Thanks @skirpichev for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
) Just like cmath_testcases.txt. These tests require IEEE 754 anyway. Correct zero sign for sqrt tests to match math.h convention. (cherry picked from commit 28aea5d) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
GH-124161 is a backport of this pull request to the 3.13 branch. |
) Just like cmath_testcases.txt. These tests require IEEE 754 anyway. Correct zero sign for sqrt tests to match math.h convention. (cherry picked from commit 28aea5d) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
GH-124162 is a backport of this pull request to the 3.12 branch. |
|
Oh, a test failed on Windows 10:
|
@skirpichev: Would you mind to have a look at the testFmod() failure? |
It's easy: windows=>bugs. Standard says: "The fmod functions compute the floating-point remainder of x/y. [...] if y is nonzero, the result has the same sign as x [...]". Does it fail on 11? Maybe it's fixed? Anyway, I'll provide patch to filter out this on Win 10. |
Is it possible to fix fmod() bug on Windows? |
Unfortunately, I can only guess how it's broken. Assuming that it's wrong only for signed zero as result, we could replace one with static double
m_fmod(double x, double y)
{
double r = fmod(x, y);
if (r == 0.0 && y != 0.0) {
r = copysign(r, x);
}
return r;
} |
The test pass on [MSC v.1941 64 bit (AMD64)] (Windows 10 buildbot), but fails on [MSC v.1916 64 bit (AMD64)] (GitHub Actions). It's more a matter of the C Compiler version (MSC). |
Just like cmath_testcases.txt. These tests require IEEE 754 anyway. Correct zero sign for sqrt tests to match math.h convention.
Just like cmath_testcases.txt. These tests require IEEE 754 anyway.