+ 2

Why 0. 2222222222222222+8. = 8. 2222222222222221

why is it not 8.2222222222222222

14th Nov 2016, 8:16 AM
An S
An S - avatar
3 Answers
+ 10
Because computers. Floating point numbers (the ones with decimal places) are only stored as an approximation inside your computer, so you can store huge and tiny numbers without requiring a lot of memory. As a result any calculation you do with floats will be a bit off. That's the sad truth! If you need more precision, python does have decimals though: https://docs.python.org/3/library/decimal.html#module-decimal
14th Nov 2016, 8:23 AM
Schindlabua
Schindlabua - avatar
0
think it this way the decimal for the 8 is in front of it so its the large number so that's why your answer was 8.222222
23rd Nov 2016, 5:23 AM
Justin Jones
Justin Jones - avatar
- 4
in which program??? ;) its obviously 8.2222more
14th Nov 2016, 8:17 AM
NabiL
NabiL - avatar