+ 1

Why 1782.3200000000002

Why are there zeros when adding argument 8.9? https://code.sololearn.com/cE4i279rSm2J/?ref=app

16th Feb 2022, 8:58 PM
Kruhliak Nataliia
Kruhliak Nataliia - avatar
1 Answer
+ 5
It has to do with the fact that (some) decimals cannot be stored precisely in binary. https://python.plainenglish.io/floating-point-arithmetic-precision-error-in-python-decimal-comes-for-rescue-8803d1290601
16th Feb 2022, 9:08 PM
Simon Sauter
Simon Sauter - avatar