+ 1
If we are using double float we can store big numbers Or not?
2 ответов
+ 1
Yes. But if you operate on them, those won't be accurate.
Floating point numbers are stored in binary, and we don't have infinite digits to store numbers. And numbers like 0.1 are not representable as a sum of some powers of 2. So we lose precision.
The arithmetic is also inaccurate and can add up modulus errors in the result, and multiple operations like this increase the error.
The following post has answers that explain why, and it applies to floating point numbers in all languages.
https://www.sololearn.com/discuss/348499/?ref=app