[issue39124] round Decimal error

Adelson Luiz de Lima report at bugs.python.org
Mon Dec 23 10:20:12 EST 2019


Adelson Luiz de Lima <adelsontads at gmail.com> added the comment:

Thanks for the quick response. 
I try the follow code in python 3.7: 
round(9.925, 2) => 9.93
round(Decimal('9.925'), 2) => Decimal('9.92')

I do not understande why behavior of float is diferrent of the Decimal.

In python 2.7 I have the same result: 9.93

----------
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39124>
_______________________________________


More information about the Python-bugs-list mailing list