diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-02-23 02:53:44 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-02-23 02:53:44 (GMT) |
commit | 739d5497c07b5350acc0f79878e4661eda4865d3 (patch) | |
tree | ca68cfd5e3b12af1f7a0534255e241ecba750a04 /Doc/library/math.rst | |
parent | ad17bc0bf971348fd49970a305094b3186b4b679 (diff) | |
download | cpython-739d5497c07b5350acc0f79878e4661eda4865d3.zip cpython-739d5497c07b5350acc0f79878e4661eda4865d3.tar.gz cpython-739d5497c07b5350acc0f79878e4661eda4865d3.tar.bz2 |
#15438: add a note to math.pow() that suggests using **/pow() for integers. Patch by Mark Dickinson.
Diffstat (limited to 'Doc/library/math.rst')
-rw-r--r-- | Doc/library/math.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/library/math.rst b/Doc/library/math.rst index c082980..b014fc4 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) |