Bitwise operations on 32-bit unsigned ints?

后端 未结 3 845
滥情空心
滥情空心 2020-12-04 15:38

JavaScript converts operands to 32-bit signed ints before doing bitwise operations. It also does the operation with 32-bit signed ints, meaning that the result is a 32-bit s

3条回答
  •  感动是毒
    2020-12-04 16:15

    JavaScript takes care of this problem by offering two bit shift operators, >> and >>>. You want >>> to do a shift without shifting the sign bit.

提交回复
热议问题