4 ms·
besides bigInt... What numbers in javascript are not actually doubles (what js uses under the hood for every number)? You can convert them from doubles to 32-
by altruios 4y ago
besides bigInt...
What numbers in javascript are not actually doubles (what js uses under the hood for every number)?
You can convert them from doubles to 32-ints apparently by some bitwise hacks like (I'm pretty sure they still are 'doubles' though - and it just does some rounding tricks)
```
|0 //signed
>>>0 //unsigned
```
So any webapp (google sheets) will likely have problems related to floating point math.
- ElectricalUnion 4y ago> You can convert them from doubles to 32-ints You can use the native BigInt arbitrary-precision integers and ignore all "fits under this arbitrary limited bit slice" problems. You can use doubles as a integer directly, in a safe way, until you touch the 53 bits barrier (Number.MIN_SAFE_INTEGER === -9007199254740991 or Number.MAX_SAFE_INTEGER === 9007199254740991). None of those really are (modern) webapp issues.