Python 相当于 JavaScript 按位 >>>
Python equivalent of the JavaScript bitwise >>>
在Python中是否有等价于JavaScript的>>>
运算符。根据 JavaScript 的 >>>
定义,运算符
Shifts right by pushing zeros in from the left, and let the rightmost bits fall off
python 中是否有任何直接运算符,因为我认为 >>
不能这样做
x << y
Returns x 位向左移动 y 位(右侧的新位为零)。这与 x
乘以 2**y
相同。
x >> y
Returns x 位向右移动 y 位。这与 x
除以 2**y
.
的整数相同
对我有用的是不对负数应用移位,这是 >>>
和 >>
之间的唯一区别
在Python中是否有等价于JavaScript的>>>
运算符。根据 JavaScript 的 >>>
定义,运算符
Shifts right by pushing zeros in from the left, and let the rightmost bits fall off
python 中是否有任何直接运算符,因为我认为 >>
不能这样做
x << y
Returns x 位向左移动 y 位(右侧的新位为零)。这与 x
乘以 2**y
相同。
x >> y
Returns x 位向右移动 y 位。这与 x
除以 2**y
.
对我有用的是不对负数应用移位,这是 >>>
和 >>