mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-110383: Clarify "non-integral" wording in pow() docs (#119688)
This commit is contained in:
parent
d5ba4fc9bc
commit
6646a9da26
1 changed files with 3 additions and 1 deletions
|
@ -1561,7 +1561,9 @@ are always available. They are listed here in alphabetical order.
|
||||||
returns ``100``, but ``pow(10, -2)`` returns ``0.01``. For a negative base of
|
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
|
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
|
result is delivered. For example, ``pow(-9, 0.5)`` returns a value close
|
||||||
to ``3j``.
|
to ``3j``. Whereas, for a negative base of type :class:`int` or :class:`float`
|
||||||
|
with an integral exponent, a float result is delivered. For example,
|
||||||
|
``pow(-9, 2.0)`` returns ``81.0``.
|
||||||
|
|
||||||
For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must
|
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
|
also be of integer type and *mod* must be nonzero. If *mod* is present and
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue