From: Ezio Melotti Date: Sat, 23 Feb 2013 02:53:44 +0000 (+0200) Subject: #15438: add a note to math.pow() that suggests using **/pow() for integers. Patch... X-Git-Tag: v3.2.4rc1~83 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=739d5497c07b5350acc0f79878e4661eda4865d3;p=thirdparty%2FPython%2Fcpython.git #15438: add a note to math.pow() that suggests using **/pow() for integers. Patch by Mark Dickinson. --- diff --git a/Doc/library/math.rst b/Doc/library/math.rst index c082980fb599..b014fc4f80f0 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)