Before flagging this as a duplicate, please read below, and check my code * my updated code! So my problem is that, I have to implement Java/JavaScript ‘>>>’ (Unsigned Right Shift / Zero-fill Right Shift), but I can’t get it work exactly the same way. I’ve selected the 11 most promising implementations I’ve found on SO and on the web
Tag: bit-shift
Bitshift in javascript
I’ve got a really big number: 5799218898. And want to shift it right to 13 bits. So, windows-calculator or python gives me: 5799218898 >> 13 | 100010100100001110011111100001 >> 13 70791 | 10001010010000111 As expected. But Javascript: 5799218898 >> 13 | 100010100100001110011111100001 >> 13 183624 | 101100110101001000 I think it because of internal integer representation in javascript, but cannot find anything