7 ms·
Yep, there are only doubles in JavaScript. With doubles, integer values work fine up to 2^53. After that point, things get silly. >>> Math.pow(2, 53) === M
by ahoge 13y ago
Yep, there are only doubles in JavaScript. With doubles, integer values work fine up to 2^53. After that point, things get silly.
>>> Math.pow(2, 53) === Math.pow(2, 53) - 1
false
>>> Math.pow(2, 53) === Math.pow(2, 53)
true
>>> Math.pow(2, 53) === Math.pow(2, 53) + 1
true // derp