Bug report
Bug description:
Consider this, for example:
Python 3.16.0a0 (heads/main:ee68f5f46a1, Aug 12 2026, 11:19:39) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> complex('inf+0j')**1
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
complex('inf+0j')**1
~~~~~~~~~~~~~~~~~^^~
OverflowError: complex exponentiation
c.f. the real case:
See also http://stackoverflow.com/q/18243270/270986
The generic algorithm returns a correct answer (match GNU MPC, for example), but sets errno incorrectly:
>>> import _testcapi
>>> _testcapi._py_c_pow(complex('inf'), 1)
((inf+nanj), 34)
>>> from gmpy2 import mpc
>>> mpc('inf')**1
mpc('inf+nanj')
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Bug report
Bug description:
Consider this, for example:
c.f. the real case:
See also http://stackoverflow.com/q/18243270/270986
The generic algorithm returns a correct answer (match GNU MPC, for example), but sets errno incorrectly:
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs