Johannes Schönberger added the comment:
sorry, I totally forgot about this...
--
___
Python tracker
<http://bugs.python.org/issue7769>
___
___
Python-bugs-list m
Johannes Schönberger added the comment:
sorry, forgot the str:
def rsin(x):
"""Return the sine of x as measured in radians.
>>> print sin(Decimal('0.5'))
0.4794255386042030002732879352
>>> print sin(0.5)
0.479425538604
&
Johannes Schönberger added the comment:
This adds two further lines, so you can pass int's, float's or Decimal types to
the function.
def sin(x):
"""Return the sine of x as measured in radians.
>>> print sin(Decimal('0.5'))
0.479425
Johannes Schönberger added the comment:
OK, will work on it and reply as soon as I have results!
--
___
Python tracker
<http://bugs.python.org/issue7769>
___
___
Johannes Schönberger added the comment:
OK, thank you for the links!
Do you still want me to do anything (like test cases etc.)?
--
___
Python tracker
<http://bugs.python.org/issue7
Johannes Schönberger added the comment:
I'm not very used to working with bug/issue trackers, is there any tutorial
here, where this is explained?
I did the stuff you asked me to do:
diff: http://paste.pocoo.org/compare/169357/169359/
test: http://paste.pocoo.org/show/1
Johannes Schönberger added the comment:
stupid, it is much better to just use the modulo operator. The same works with
cos...
def sin(x):
"""Return the sine of x as measured in radians.
>>> print sin(Decimal('0.5'))
0.4794255386042030
Johannes Schönberger added the comment:
This is the version I would suggest and which is quite accurate unless the
numbers get extremely large.
def sin(x):
"""Return the sine of x as measured in radians.
>>> print sin(Decimal('0.5'))
0.47942553
New submission from Johannes Schönberger :
Unfortunately the sin/cos function in the decimal docs seems to return false
results.
In [33]: sin(decimal.Decimal('75'))
Out[33]: Decimal('0.377879483645203210442266845614')
In [34]: sin(decimal.Decimal(
New submission from Johannes Schönberger :
I would suggest to make SimpleXMLRPCServer.SimpleXMLRPCServer.register_function
a decorator function.
See the attached file for the solution I wrote (l.209-240), which also works
with the current syntax:
@server.register_function
10 matches
Mail list logo