mirror of
https://github.com/python/cpython.git
synced 2025-09-27 18:59:43 +00:00
Issue #7770: Note the useful range of sin/cos in the decimal module examples.
This commit is contained in:
parent
a491cedaf4
commit
2a1e3e29d4
1 changed files with 6 additions and 0 deletions
|
@ -1717,6 +1717,9 @@ to work with the :class:`Decimal` class::
|
||||||
def cos(x):
|
def cos(x):
|
||||||
"""Return the cosine of x as measured in radians.
|
"""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')))
|
>>> print(cos(Decimal('0.5')))
|
||||||
0.8775825618903727161162815826
|
0.8775825618903727161162815826
|
||||||
>>> print(cos(0.5))
|
>>> print(cos(0.5))
|
||||||
|
@ -1740,6 +1743,9 @@ to work with the :class:`Decimal` class::
|
||||||
def sin(x):
|
def sin(x):
|
||||||
"""Return the sine of x as measured in radians.
|
"""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')))
|
>>> print(sin(Decimal('0.5')))
|
||||||
0.4794255386042030002732879352
|
0.4794255386042030002732879352
|
||||||
>>> print(sin(0.5))
|
>>> print(sin(0.5))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue