mirror of
https://github.com/python/cpython.git
synced 2025-11-27 13:45:25 +00:00
Add a note about pow(x,y) equalling x**y (the "**" operator
was used unmotivated in the pow() docs)
This commit is contained in:
parent
59b96c1029
commit
48b4bf7b1a
1 changed files with 5 additions and 2 deletions
|
|
@ -735,8 +735,11 @@ class C:
|
||||||
\begin{funcdesc}{pow}{x, y\optional{, z}}
|
\begin{funcdesc}{pow}{x, y\optional{, z}}
|
||||||
Return \var{x} to the power \var{y}; if \var{z} is present, return
|
Return \var{x} to the power \var{y}; if \var{z} is present, return
|
||||||
\var{x} to the power \var{y}, modulo \var{z} (computed more
|
\var{x} to the power \var{y}, modulo \var{z} (computed more
|
||||||
efficiently than \code{pow(\var{x}, \var{y}) \%\ \var{z}}). The
|
efficiently than \code{pow(\var{x}, \var{y}) \%\ \var{z}}).
|
||||||
arguments must have numeric types. With mixed operand types, the
|
The two-argument form \code{pow(\var{x}, \var{y})} is equivalent to using
|
||||||
|
the power operator: \code{\var{x}**\var{y}}.
|
||||||
|
|
||||||
|
The arguments must have numeric types. With mixed operand types, the
|
||||||
coercion rules for binary arithmetic operators apply. For int and
|
coercion rules for binary arithmetic operators apply. For int and
|
||||||
long int operands, the result has the same type as the operands
|
long int operands, the result has the same type as the operands
|
||||||
(after coercion) unless the second argument is negative; in that
|
(after coercion) unless the second argument is negative; in that
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue