As I understand it, JS treats numbers as 32-bits when performing bit-shift operations, even though it supports 64-bit numbers.
How can I implement a leftShift
function that works on 64-bit numbers? i.e., it won't roll over into the negatives for something like 192 << 24
(should be 3221225472
, not -1073741824
).