4 ms·
JavaScript stores all numbers as 64-bit floating points, so precision is limited to 53 bits (52 stored plus an implied leading 1). There are, of course, edge c
by lmkg 5y ago
JavaScript stores all numbers as 64-bit floating points, so precision is limited to 53 bits (52 stored plus an implied leading 1).
There are, of course, edge cases. For example, despite the fact that numbers are floats, you can still perform bit operations on them. For these operations, the numbers are implicitly converted to 32-bit ints.
JavaScript also has Typed Arrays, so you can have an array of 32-bit unsigned ints. But not a u32 itself.