0
0.03-0.0218 = 0.008199999999999999 

why is it that? I am using javascript.

Sagar V
  • 12,158
  • 7
  • 41
  • 68
Nomura Nori
  • 4,689
  • 8
  • 47
  • 85
  • 2
    Floating point arithmetic is approximative. Either use a library that does deal with it or accept the small error. – Swann Mar 18 '17 at 05:49
  • Thanks but there seems to be no answer how to get right result, I need 0.0082. They said about the reason, but now I need real solution. – Nomura Nori Mar 18 '17 at 05:54
  • May be worth exploring [Big.JS](https://mikemcl.github.io/big.js/) – haxxxton Mar 18 '17 at 05:54

0 Answers0