Hacker News new | ask | show | jobs
by blixt 613 days ago
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
1 comments

I assume by binary you mean logical? A + b certainly does not treat either side as 32bit.
Sorry, I meant bitwise operators, such as: ~ >> << >>> | &