diff options
author | Raymond Hettinger <python@rcn.com> | 2010-11-21 02:47:22 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2010-11-21 02:47:22 (GMT) |
commit | 2a1e3e29d4015aa7f029ba819c46b3790b3e4a3d (patch) | |
tree | 69e1fea079d2a496bae157faf051822287e8912a | |
parent | a491cedaf45252cb8431b0fd45bc0383cd00115b (diff) | |
download | cpython-2a1e3e29d4015aa7f029ba819c46b3790b3e4a3d.zip cpython-2a1e3e29d4015aa7f029ba819c46b3790b3e4a3d.tar.gz cpython-2a1e3e29d4015aa7f029ba819c46b3790b3e4a3d.tar.bz2 |
Issue #7770: Note the useful range of sin/cos in the decimal module examples.
-rw-r--r-- | Doc/library/decimal.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index d0dedda..d1e8bc7 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -1717,6 +1717,9 @@ to work with the :class:`Decimal` class:: def cos(x): """Return the cosine of x as measured in radians. + The taylor series approximation works best for a small value of x. + For larger values, first compute x = x % (2 * pi). + >>> print(cos(Decimal('0.5'))) 0.8775825618903727161162815826 >>> print(cos(0.5)) @@ -1740,6 +1743,9 @@ to work with the :class:`Decimal` class:: def sin(x): """Return the sine of x as measured in radians. + The taylor series approximation works best for a small value of x. + For larger values, first compute x = x % (2 * pi). + >>> print(sin(Decimal('0.5'))) 0.4794255386042030002732879352 >>> print(sin(0.5)) |