summaryrefslogtreecommitdiffstats
path: root/Doc/library/math.rst
diff options
context:
space:
mode:
authorAndrew Kuchling <amk@amk.ca>2014-02-16 16:11:25 (GMT)
committerAndrew Kuchling <amk@amk.ca>2014-02-16 16:11:25 (GMT)
commit8cb1ec3274fff35a3613dd9fa8f0c99b4f472119 (patch)
tree0feb034462e8c04ce23215922735d83bab094b0c /Doc/library/math.rst
parente5235f162449f5faf63381197f243ef8d51acd19 (diff)
downloadcpython-8cb1ec3274fff35a3613dd9fa8f0c99b4f472119.zip
cpython-8cb1ec3274fff35a3613dd9fa8f0c99b4f472119.tar.gz
cpython-8cb1ec3274fff35a3613dd9fa8f0c99b4f472119.tar.bz2
#12211: clarify math.copysign() documentation and docstring
Diffstat (limited to 'Doc/library/math.rst')
-rw-r--r--Doc/library/math.rst7
1 files changed, 5 insertions, 2 deletions
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
index 7c3ab59..0083409 100644
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -36,9 +36,12 @@ Number-theoretic and representation functions
.. function:: copysign(x, y)
- Return *x* with the sign of *y*. On a platform that supports
- signed zeros, ``copysign(1.0, -0.0)`` returns *-1.0*.
+ Return a float with the magnitude (absolute value) of *x* but the sign of
+ *y*. On platforms that support signed zeros, ``copysign(1.0, -0.0)``
+ returns *-1.0*.
+ If *x* is NaN, *y* is ignored and NaN is returned. If *y* is NaN,
+ it is treated as positive: ``copysign(-1.0, NaN)`` returns 1.0.
.. function:: fabs(x)