If i subtract .01 from 100000000000000 like 100000000000000 - Math.pow(10,(-1 * 2)), i am getting 99999999999999. 98. If i cut one zero from the number, result is correct and if i add one more zero to the number, subtraction won't happen.Can somebody help to solve it?
Subtraction Problem in Javascript
Collapse
X
-
Tags: None
-
Subtraction Problem in Javascript
In Javascript if i subtract .01 from 100000000000000 like 100000000000000 - Math.pow(10,(-1 * 2)), i am getting 99999999999999. 98. If i cut one zero from the number, result is correct and if i add one more zero to the number, subtraction won't happen.Can somebody help to solve it? -
Did you find an answer? I was surprised to discovered that 250 - 39.92 = 210.07999999999 998 in both IE and Firefox.Originally posted by prasadmoyarathIn Javascript if i subtract .01 from 100000000000000 like 100000000000000 - Math.pow(10,(-1 * 2)), i am getting 99999999999999. 98. If i cut one zero from the number, result is correct and if i add one more zero to the number, subtraction won't happen.Can somebody help to solve it?
RgrdsComment
Comment