diff options
author | Georg Brandl <georg@python.org> | 2006-03-21 08:48:04 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-03-21 08:48:04 (GMT) |
commit | 48b4bf7b1a0feae48df27d7ecb9fdde448ef432d (patch) | |
tree | a43d9f61485b9005fa4010961db0cf6cc000cacf /Doc | |
parent | 59b96c1029290822b7069634fce4628b19b2d4ca (diff) | |
download | cpython-48b4bf7b1a0feae48df27d7ecb9fdde448ef432d.zip cpython-48b4bf7b1a0feae48df27d7ecb9fdde448ef432d.tar.gz cpython-48b4bf7b1a0feae48df27d7ecb9fdde448ef432d.tar.bz2 |
Add a note about pow(x,y) equalling x**y (the "**" operator
was used unmotivated in the pow() docs)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/libfuncs.tex | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex index 9b6bfe9..eeed877 100644 --- a/Doc/lib/libfuncs.tex +++ b/Doc/lib/libfuncs.tex @@ -735,8 +735,11 @@ class C: \begin{funcdesc}{pow}{x, y\optional{, z}} 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 - efficiently than \code{pow(\var{x}, \var{y}) \%\ \var{z}}). The - arguments must have numeric types. With mixed operand types, the + efficiently than \code{pow(\var{x}, \var{y}) \%\ \var{z}}). + 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 long int operands, the result has the same type as the operands (after coercion) unless the second argument is negative; in that |