3 ms·
Simplest one: open up Python, enter: ((.1)*3)/3 It should come up as 0.10000000000000002. I honestly don't understand the reason, though.
by vertex-four 12y ago
Simplest one: open up Python, enter:
((.1)*3)/3
It should come up as 0.10000000000000002. I honestly don't understand the reason, though.
- detaro 12y agoThese are normal floats, not Decimals, which are Python's exact floating point type.
- wldcordeiro 12y agoYou're thinking of floats which are different than the Decimal type[1]. https://docs.python.org/3/library/decimal.html?highlight=decimal#module-decimal https://docs.python.org/3/library/decimal.html?highlight=dec...