Bitshift in javascript

后端 未结 3 1748
眼角桃花
眼角桃花 2020-12-06 15:56

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 | 10001010010000         


        
3条回答
  •  一生所求
    2020-12-06 16:54

    As Nicholas Zakas states:

    Even though JavaScript numbers are technically stored in 64-bits, integer values are treated as if they’re 32 bits whenever bitwise operators are involved.

提交回复
热议问题