Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 7 commits into from
Aug 6, 2024

Conversation

skirpichev
Copy link
Contributor

@skirpichev skirpichev commented Aug 5, 2024


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.

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.).
Copy link
Member

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 ;-)

Copy link
Contributor Author

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

Copy link
Member

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 :-)

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vstinner
Copy link
Member

vstinner commented Aug 6, 2024

I merged the main branch into this PR to retrieve the Hypothesis workaround (pin attrs version).

@vstinner vstinner merged commit 0b433aa into python:main Aug 6, 2024
35 checks passed
@vstinner
Copy link
Member

vstinner commented Aug 6, 2024

Merged. Thank you.

@skirpichev skirpichev deleted the m_atan2-122681 branch August 6, 2024 12:48
brandtbucher pushed a commit to brandtbucher/cpython that referenced this pull request Aug 7, 2024
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants