]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44344: Document that pow can return a complex number for non-complex inputs....
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 21 Oct 2021 22:08:20 +0000 (15:08 -0700)
committerGitHub <noreply@github.com>
Thu, 21 Oct 2021 22:08:20 +0000 (00:08 +0200)
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
(cherry picked from commit 887a55705bb6c05a507c2886c9978a9e0cff0dd7)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
Doc/library/functions.rst

index f4c3ef4600f6b749f5a32ff130ddcf20e0b480cf..689455409eec38bf85f9de4551ce25e4be67ded2 100644 (file)
@@ -1357,7 +1357,10 @@ are always available.  They are listed here in alphabetical order.
    operands, the result has the same type as the operands (after coercion)
    unless the second argument is negative; in that case, all arguments are
    converted to float and a float result is delivered.  For example, ``pow(10, 2)``
-   returns ``100``, but ``pow(10, -2)`` returns ``0.01``.
+   returns ``100``, but ``pow(10, -2)`` returns ``0.01``.  For a negative base of
+   type :class:`int` or :class:`float` and a non-integral exponent, a complex
+   result is delivered.  For example, ``pow(-9, 0.5)`` returns a value close
+   to ``3j``.
 
    For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must
    also be of integer type and *mod* must be nonzero. If *mod* is present and