What does 1e + 24 console mean?

6

I noticed that when I type in the chrome console 1000000000000000000000000 it returns me 1e+24 .

And when I type 1000000000000000009901591 it also returns me 1e+24 and 1000000000000000000000000 is different from 1000000000000000009901591

  • Why does this happen?
  • And how to differentiate the two?
  • asked by anonymous 01.04.2014 / 19:23

    1 answer

    11

    This is an exponential representation. It is not possible to differentiate the two because these numbers extrapolate the maximum precision of the numeric type used by javascript, which is below% of the IEEE 754 standard type.

    The exponential representation works like this:

    M and E = > M × 10 E

    M e- E = > M × 10 -E

    For the number indicated, we have M = 1, and E = 24 positive. Then the final value will be:

    1 × 10 24 , that is, 1 followed by 24 zeros.

        
    01.04.2014 / 19:26