6
I noticed that when I type in Chrome console 1000000000000000000000000
he returns me 1e+24
.
And when I type 1000000000000000009901591
he also returns to me 1e+24
whereas 1000000000000000000000000
is different from 1000000000000000009901591
- Why does that happen?
- And how to differentiate the two?
In this case, Chrome uses the
V8
and it is possible to confirm thedouble
that Miguel Angelo said for the documentation: http://izs.me/v8-docs/classv8_1_1Number.html– Lucas Lima
Note that this standard (IEEE 754, used by most processors) does not allow specifying more than 17 significant digits. And the 17th is often a rounding.
– user4552