0
Why is 0.1 + 0.2 -0.3 not equal to zero?
3 odpowiedzi
+ 6
https://docs.python.org/2/tutorial/floatingpoint.html
+ 4
It's because these numbers will convert to binary then computer can read them and use them so there will be a little difference
as 0.2 will be 0.2000000001
but there's another method which helps for comparing numbers that can solve this
0
This reeally depents on your language.
In many language floats are unstable. If you want a full readup:
https://stackoverflow.com/questions/21895756/why-are-floating-point-numbers-inaccurate