[issue15996] pow() for complex numbers is rough around the edges

Terry J. Reedy report at bugs.python.org
Sat Sep 22 04:14:07 CEST 2012


Terry J. Reedy added the comment:

Given that
>>> 1.0**float('inf'), 1.0**float('-inf')
(1.0, 1.0)

works,

>>> (1.0+0j)**(float('inf') + 0j)
Traceback ...
ZeroDivisionError: 0.0 to a negative or complex power

(and same for ('-inf') seems like a clear bug in raising an exception, let alone a clearly wrong exception. Clarification of murky cases, if it changes behavior, might be an enhancement.

----------
nosy: +terry.reedy
stage:  -> test needed
versions: +Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15996>
_______________________________________


More information about the Python-bugs-list mailing list