Title: Merge m_atan2() and c_atan2() helper functions (or replace libm's atan2) · Issue #122681 · python/cpython · GitHub
Open Graph Title: Merge m_atan2() and c_atan2() helper functions (or replace libm's atan2) · Issue #122681 · python/cpython
X Title: Merge m_atan2() and c_atan2() helper functions (or replace libm's atan2) · Issue #122681 · python/cpython
Description: 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 static double m_atan2(double y, double x) { if ...
Open Graph Description: 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 static ...
X Description: 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 static ...
Opengraph URL: https://github.com/python/cpython/issues/122681
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Merge m_atan2() and c_atan2() helper functions (or replace libm's atan2)","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nWith #29179, many workarounds for buggy libm implementations were removed. Yet, there is ``m_atan2()``:\nhttps://github.com/python/cpython/blob/d0b92dd5ca46a10558857adeb7bb48ecf39fa783/Modules/mathmodule.c#L546-L572\nand\nhttps://github.com/python/cpython/blob/d0b92dd5ca46a10558857adeb7bb48ecf39fa783/Modules/cmathmodule.c#L329-L355\n\nThey are identical, the second one just uses ``Py_complex`` to keep arguments.\n\nWe should either 1) move first helper to ``_math.h`` and reuse it in the ``cmathmodule.c`` or 2) just remove these helpers. I'll provide patch for 1) proposal.\n\nBut 2) looks also safe for me: it seems that ``c_atan2()`` helper was used only for ``cmath.phase()`` and ``cmath.polar()``; libm's ``atan2()`` 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 for ``acos()``.) \n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-122682\n* gh-122715\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/skirpichev","@type":"Person","name":"skirpichev"},"datePublished":"2024-08-05T07:50:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/122681/cpython/issues/122681"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9e067c02-2850-a09f-cebf-534ce09bba2c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D030:159D04:406ED:525C0:696B31E2 |
| html-safe-nonce | d8589170b769908199faa8285aab63a2577fa0158b5b817d8922ea79041c4720 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDMwOjE1OUQwNDo0MDZFRDo1MjVDMDo2OTZCMzFFMiIsInZpc2l0b3JfaWQiOiI0Mzc4NjQ4ODA0MTgxMzU3MDI2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7fdd73af23d0eb0b8ee7ed59f56cdaa8a236964515d8f7de68fde50dbc2a48b2 |
| hovercard-subject-tag | issue:2447862291 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/122681/issue_layout |
| twitter:image | https://opengraph.githubassets.com/03522073c3ac31b8f572040ecb60a8f160c2710e90b3ee60a989e377a376a413/python/cpython/issues/122681 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/03522073c3ac31b8f572040ecb60a8f160c2710e90b3ee60a989e377a376a413/python/cpython/issues/122681 |
| og:image:alt | 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 static ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | skirpichev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width