I am doing the following calculation with javascript:
0.1111111111111115 * Math.pow(10,18)
it gave me: 111111111111111490
however, if I do
(0.1111111111111115 * Math.pow(10,17))*10
it will give me the correct result: 111111111111111500
why will it happen and how to prevent it?
Thank you!