4 ms·
If you want bigger than 32 bits but not the whole 64 bits (up to 53 bits I think) you can just do Math.floor(). But you'll want a range check in that case. On
by dataflow 4y ago
If you want bigger than 32 bits but not the whole 64 bits (up to 53 bits I think) you can just do Math.floor(). But you'll want a range check in that case.
On that note: why does |0 and >>>0 needlessly chop to 32 bits when they can represent more?
- BoppreH 4y agoBe careful with Math.floor on negative numbers. It rounds -1.1 to -2. You probably want the new Math.trunc.