Hi, not sure if this is intended behavior or not. What I understood from the doc.txt is that .R with a float as arg b results in basically: round(a, get_precision(b)):
➜ pyth git:(master) git show-ref master
e72b4a42499b73b7fc50aca066752aa8ac0274c0 refs/heads/master
e72b4a42499b73b7fc50aca066752aa8ac0274c0 refs/remotes/origin/master
➜ pyth git:(master) python3
Python 3.4.2 (default, Jan 12 2015, 12:13:20)
[GCC 4.9.2 20150107 (Red Hat 4.9.2-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyth import run_code
>>> run_code('.RQQ', '60.5')
('60.0\n', None)
>>> run_code('.RQQ', '-60.5')
('-60.5\n', None)
>>> run_code('.RQQ', '10.5')
('10.5\n', None)
>>> run_code('.RQQ', '-10.5')
('-10.5\n', None)
Hi, not sure if this is intended behavior or not. What I understood from the doc.txt is that .R with a float as arg b results in basically:
round(a, get_precision(b))
:A quick and dirty fix: https://gist.github.com/winny-/8c13daeafd6850e0ac6d I think you can also do this using the decimal module.
Other discussion: http://chat.stackexchange.com/transcript/message/23007352#23007352
Comparison to plain python3
round(a, 1)
: