Re:SetBigTimeout
by blixt on Friday October 18, 2024 @01:38PM
(#41881685)
JS numbers technically have 53 bits for integers (mantissa) but all binary operators turns it into a 32-bit signed integer. Maybe this is related somehow to the setTimeout limitation. JavaScript also has the >>> unsigned bit shift operator so you can squeeze that last bit out of it if you only care about positive values: ((2*32-1)>>>0).toString(2).length === 32
[ Parent
| on HN ]
I assume by binary you mean logical? A + b certainly does not treat either side as 32bit.