summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-02-23 04:53:44 +0200
committerEzio Melotti <ezio.melotti@gmail.com>2013-02-23 04:53:44 +0200
commit739d5497c07b5350acc0f79878e4661eda4865d3 (patch)
treeca68cfd5e3b12af1f7a0534255e241ecba750a04
parentad17bc0bf971348fd49970a305094b3186b4b679 (diff)
downloadcpython-git-739d5497c07b5350acc0f79878e4661eda4865d3.tar.gz
#15438: add a note to math.pow() that suggests using **/pow() for integers. Patch by Mark Dickinson.
-rw-r--r--Doc/library/math.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
index c082980fb5..b014fc4f80 100644
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -202,6 +202,10 @@ Power and logarithmic functions
``x`` is negative, and ``y`` is not an integer then ``pow(x, y)``
is undefined, and raises :exc:`ValueError`.
+ Unlike the built-in ``**`` operator, :func:`math.pow` converts both
+ its arguments to type :class:`float`. Use ``**`` or the built-in
+ :func:`pow` function for computing exact integer powers.
+
.. function:: sqrt(x)