3 ms·
Obligatory informational: JavaScript numbers are IEEE-754 standard. You get 53 bits of precision, but can still represent other numbers outside that range, and
by IggleSniggle 7y ago
Obligatory informational:
JavaScript numbers are IEEE-754 standard. You get 53 bits of precision, but can still represent other numbers outside that range, and there are the usual issues relating to dealing with floats.
Math.pow(2,53)
// 9007199254740992
Math.pow(2,53)+1
// 9007199254740992
Math.pow(2,53)+2
// 9007199254740994
0.1 + 0.2
// 0.30000000000000004