Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-119771: adjust errno on overflows in _Py_c_pow()#120256
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Before we did this in complex_pow() and behaviour of the public C APIfunction ``_Py_c_pow()`` was different from the pure-python pow().
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Victor Stinner <vstinner@python.org>
| // a faster and more accurate algorithm. | ||
| if (b.imag==0.0&&b.real==floor(b.real)&&fabs(b.real) <=100.0) { | ||
| p=c_powi(a, (long)b.real); | ||
| _Py_ADJUST_ERANGE2(p.real,p.imag); |
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.
That might be moved toc_powi(), but that will make patch slightly larger. I think this is fine, asc_powi() is not a part of C API.
vstinner left a comment
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
skirpichev commentedSep 18, 2024
@vstinner, do you want a second opinion on this? |
vstinner left a comment
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
vstinner commentedSep 18, 2024
Merged, thanks. I made minor edits on the commit message. |
Before we did this in complex_pow() and behavior of the public C APIfunction _Py_c_pow() was different from the pure-python pow().
Uh oh!
There was an error while loading.Please reload this page.
Before we did this in complex_pow() and behaviour of the public C API function
_Py_c_pow()was different from the pure-python pow().📚 Documentation preview 📚:https://cpython-previews--120256.org.readthedocs.build/