2014-09-03 102 views
0

我看到以下內容:這個JavaScript運算符在做什麼?

((2 * 45) + (2 * 124) + 100) >>> 3 

自身在控制檯把這個揭示了價值54

是什麼>>> 3的目的是什麼?

+1

https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Unsigned_right_shift – Andy 2014-09-03 14:12:26

+0

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators – 2014-09-03 14:13:14

+0

[更多信息在這裏](http://stackoverflow.com/questions/19077902/bitwise-operation-zero-fill-right-shift-usages) – Andy 2014-09-03 14:14:10

回答

0

這是Zero-fill right shift按位運算符。

從Mozilla開發者網絡文檔:

該運算符將第一操作數的位到右側的指定數量。向右移位的過多位被丟棄。零位從左側移入。符號位變爲0,所以結果總是非負的。