0

Why in console I see false?

console.log(0.1 + 0.2 == 0.3);
Kamil Kiełczewski
  • 85,173
  • 29
  • 368
  • 345
  • 2
    Because you can't compare floating point numbers. You need to check their difference - `console.log(0.1 + 0.2 - 0.3 < 0.001);` – Artem Mostyaev Jul 14 '16 at 06:55
  • 1
    Take a look at [How to deal with floating point number precision in JavaScript?](http://stackoverflow.com/questions/1458633/how-to-deal-with-floating-point-number-precision-in-javascript) – oberbics Jul 14 '16 at 06:56

0 Answers0