This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients Dennis Sweeney, docs@python, eyadams, mark.dickinson
Date 2021-06-08.16:20:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>

> I think the relevant property is that the exponent is not an integer

Yep: the delegation to complex pow kicks in after handling infinities and nans, and only for strictly negative base (-0.0 doesn't count as negative for this purpose) and non-integral exponent.

Here's the relevant code:

To avoid confusion, we should probably not mention fractions like `1/3` and `4/3` as example exponents in the documentation, since those hit the What-You-See-Is-Not-What-You-Get nature of binary floating-point. Mathematically, `z^(1/3)` is a very different thing from `z^(6004799503160661/18014398509481984)` for a negative real number `z`, and the latter is what's _actually_ being computed with `z**(1/3)`. The advantage of the principal branch approach is that it's continuous in the exponent, so that `z^(1/3)` and `z^(6004799503160661/18014398509481984)` only differ by a tiny amount.
Date User Action Args
2021-06-08 16:20:04mark.dickinsonsetrecipients: + mark.dickinson, docs@python, Dennis Sweeney, eyadams
2021-06-08 16:20:04mark.dickinsonsetmessageid: <>
2021-06-08 16:20:04mark.dickinsonlinkissue44344 messages
2021-06-08 16:20:04mark.dickinsoncreate