11 ms·
Explanation for this behaviour is explained here - https://docs.python.org/3/library/decimal.html https://docs.python.org/3/library/decimal.html
by edrobap 6y ago
Explanation for this behaviour is explained here - https://docs.python.org/3/library/decimal.html https://docs.python.org/3/library/decimal.html
- AlexHerbert 6y agoThank you
- asplake 6y agoFloating point isn't the issue. 'and' is a logical operator here. 0.1 and 0.1 is 0.1.
- edrobap 6y agoI believe author wanted to discuss addition and not logical operation. With logical operation, the question become trivial.