Title: gh-153144: Avoid checking `errno` for `atan2` by hpkfft · Pull Request #153148 · python/cpython · GitHub
Open Graph Title: gh-153144: Avoid checking `errno` for `atan2` by hpkfft · Pull Request #153148 · python/cpython
X Title: gh-153144: Avoid checking `errno` for `atan2` by hpkfft · Pull Request #153148 · python/cpython
Description: The C23 standard states that for atan2 and atan2pi: A domain error may occur if both arguments are zero. A range error occurs if x is positive and nonzero y/x is too close to zero. Since Python should not raise ValueError in either of these cases (i.e., when both arguments are zero or when the computation underflows), this PR avoids checking errno when calling these trig functions. As a bonus, math.atan2() is about 4% faster. Issue: gh-153144 The statement about range error in the standard should, I think, be interpreted as: A range error occurs if (x is positive) and (y/x is nonzero) and (y/x is too close to zero).
Open Graph Description: The C23 standard states that for atan2 and atan2pi: A domain error may occur if both arguments are zero. A range error occurs if x is positive and nonzero y/x is too close to zero. Since Python s...
X Description: The C23 standard states that for atan2 and atan2pi: A domain error may occur if both arguments are zero. A range error occurs if x is positive and nonzero y/x is too close to zero. Since Python s...
Opengraph URL: https://github.com/python/cpython/pull/153148
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:933cb4bb-8517-3b4f-3c0c-3cc88925939f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8B98:203A5F:18BE196:21CF0D7:6A53EAC8 |
| html-safe-nonce | 22f5f1077908c2a045017424a91141ce97d774297d433f051d8f0a5e112daf86 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Qjk4OjIwM0E1RjoxOEJFMTk2OjIxQ0YwRDc6NkE1M0VBQzgiLCJ2aXNpdG9yX2lkIjoiNDk0MzU1NjQ1NTI1MTA0NTA2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7bb1c3d83e7ebd990314132aec3c2fc49661d1a1c4207d8cf0f1ca8d2097667a |
| hovercard-subject-tag | pull_request:3994575738 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/153148/files |
| twitter:image | https://avatars.githubusercontent.com/u/142685350?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/142685350?s=400&v=4 |
| og:image:alt | The C23 standard states that for atan2 and atan2pi: A domain error may occur if both arguments are zero. A range error occurs if x is positive and nonzero y/x is too close to zero. Since Python s... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width