-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Merge m_atan2() and c_atan2() helper functions (or replace libm's atan2) #122681
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
Labels
type-feature
A feature request or enhancement
Comments
skirpichev
added a commit
to skirpichev/cpython
that referenced
this issue
Aug 5, 2024
skirpichev
added a commit
to skirpichev/cpython
that referenced
this issue
Aug 6, 2024
vstinner
pushed a commit
that referenced
this issue
Aug 6, 2024
brandtbucher
pushed a commit
to brandtbucher/cpython
that referenced
this issue
Aug 7, 2024
kumaraditya303
pushed a commit
that referenced
this issue
Aug 17, 2024
jeremyhylton
pushed a commit
to jeremyhylton/cpython
that referenced
this issue
Aug 19, 2024
blhsing
pushed a commit
to blhsing/cpython
that referenced
this issue
Aug 22, 2024
blhsing
pushed a commit
to blhsing/cpython
that referenced
this issue
Aug 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Feature or enhancement
Proposal:
With #29179, many workarounds for buggy libm implementations were removed. Yet, there is
m_atan2()
:cpython/Modules/mathmodule.c
Lines 546 to 572 in d0b92dd
and
cpython/Modules/cmathmodule.c
Lines 329 to 355 in d0b92dd
They are identical, the second one just uses
Py_complex
to keep arguments.We should either 1) move first helper to
_math.h
and reuse it in thecmathmodule.c
or 2) just remove these helpers. I'll provide patch for 1) proposal.But 2) looks also safe for me: it seems that
c_atan2()
helper was used only forcmath.phase()
andcmath.polar()
; libm'satan2()
used for the rest - and this don't poses any problems in CI or build bots. ("Problem" values are tested, e.g. infinities and nans foracos()
.)Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: