0

In javascript, I'm doing this subtraction:
1.0589 - 1.0584

To my best math knowledge, the result should be:
0.0005

But it's not in javascript. The result I get is:
0.0004999999999999449

Am I missing something?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
rassom
  • 2,896
  • 5
  • 34
  • 45
  • 1
    You might be interested to read this article: http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html – a_pradhan Feb 03 '15 at 07:48
  • 1
    roundNumber(0.0004999999999999449,4) //returns 0.0005 you just missing a function to round the decimal places. Try above function. – Deeper Feb 03 '15 at 07:48

0 Answers0