From 739d5497c07b5350acc0f79878e4661eda4865d3 Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Sat, 23 Feb 2013 04:53:44 +0200 Subject: [PATCH] #15438: add a note to math.pow() that suggests using **/pow() for integers. Patch by Mark Dickinson. --- Doc/library/math.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/library/math.rst b/Doc/library/math.rst index c082980fb59..b014fc4f80f 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)