]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#15438: add a note to math.pow() that suggests using **/pow() for integers. Patch...
authorEzio Melotti <ezio.melotti@gmail.com>
Sat, 23 Feb 2013 02:53:44 +0000 (04:53 +0200)
committerEzio Melotti <ezio.melotti@gmail.com>
Sat, 23 Feb 2013 02:53:44 +0000 (04:53 +0200)
Doc/library/math.rst

index c082980fb599c48ee28f96ad724921d183ce6fbe..b014fc4f80f08e16885eb30d8594ebdbf9e4f8d3 100644 (file)
@@ -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)