gh-156886: Fix spurious ZeroDivisionError for complex powers - #156887
Conversation
cos() and sin() of an infinite phase set errno to EDOM, which complex_pow() reported as a zero base. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Not sure that this is the best solution, but it is the simplest. |
|
🤖 New build scheduled with the buildbot fleet by @skirpichev for commit 08cc039 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F156887%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|
This PR has the side effect that the public C API function The Linux man page for errno says, "The value of errno is never set to zero by any system call or library function." When I merged main into #156968 this change (setting errno to zero) was removed, so merging that PR is another option available to you. 😉 |
cos()andsin()of an infinite phase seterrnotoEDOM, whichcomplex_pow()reported as a zero base.🤖 Generated with Claude Code