Just faced a strange behaviour in google chrome. It performs calculations incorrectly with float numbers. When I type in console 59.9 - 0.1
it gives 59.8
, but if I type 59.8 - 0.1
it gives 59.699999999999996
. Why does it happen and how to fix it? Version I am using is 45.0.2454.101 m.
Asked
Active
Viewed 13 times
1

iamawebgeek
- 2,713
- 1
- 18
- 34