[issue44344] Documentation for pow() should include the possibility of complex numbers as a return type

Erik Y. Adams report at bugs.python.org
Mon Jun 21 11:38:07 EDT 2021


Erik Y. Adams <erikyadams at outlook.com> added the comment:

I still think the most important aspect of this is that pow() will return complex numbers, contrary to what is implied by the statement I quoted at the beginning of this thread. 

Perhaps we should just borrow from the documentation for the power operator, which says:

Raising 0.0 to a negative power results in a ZeroDivisionError. Raising a negative number to a fractional power results in a complex number. (In earlier versions it raised a ValueError.)

https://docs.python.org/3/reference/expressions.html#the-power-operator

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44344>
_______________________________________


More information about the Python-bugs-list mailing list