-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-122681: merge m_atan2() and c_atan2() helper functions #122682
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
Conversation
is necessary to get consistent behaviour across platforms. | ||
Windows, FreeBSD and alpha Tru64 are amongst platforms that don't | ||
always follow C99. Windows screws up atan2 for inf and nan, and | ||
alpha Tru64 5.1 doesn't follow C99 for atan2(0., 0.). |
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.
I'm curious if Windows and FreeBSD still need these workaround in 2024. But I don't ask you to test ;-)
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.
I'm curious if Windows and FreeBSD still need these workaround in 2024.
I doubt, especially FreeBSD.
As I said in the description, most functions in the cmath works with libm's atan2 function (e.g. acos). I think it's safe to remove these helpers. But this should be heavily tested. Here is a draft pr with this attempt: #122715
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.
I doubt, especially FreeBSD.
Right. When I added math.fma(), I found a bug on FreeBSD. It takes a while to get it fixed upstream, but it's being fixed: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277783 :-)
Misc/NEWS.d/next/Library/2024-08-05-10-52-51.gh-issue-122681.q0T58t.rst
Outdated
Show resolved
Hide resolved
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
I merged the main branch into this PR to retrieve the Hypothesis workaround (pin attrs version). |
Merged. Thank you. |
For reviewers: as it mentioned in the issue, I think it worth to try removing these workarounds. Most cmath's functions are using libm's atan2() and this don't poses any problems. If that does make sense, here is a draft pr to test this: #122715.