how to divide exponential values in javascript

20 Views Asked by At

I want to divide the exponential values by 1000 in Javascript. For now I am using this calculation:

1.02e+30 / Math.pow(10, 3) 

In this case I am getting result as 1.0200000000000001e+27, but if I divide 1.03e+30 / Math.pow(10, 3) this value I am getting 1.03e+27 like this. Can anyone please explain why I am getting like this.

1.02e+30 / Math.pow(10, 3) ==\> 1.0200000000000001e+27

1.03e+30 / Math.pow(10, 3) == \> 1.03e+27
0

There are 0 best solutions below