Bitshift in javascript

In ECMAScript (Javascript) bitwise operations are always in 32-bit. Therefore 5799218898 is chopped into 32-bit which becomes 1504251602. This integer >> 13 gives 183624.

In Python they are arbitrary-length integers. So there’s no problem.

(And the numbers in Windows calculator are 64-bit, enough to fit 5799218898.)

(And the correct answer should be 707912.)

Leave a Comment