0

I've seen the following:

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

Putting this in a console on its own reveals the value 54.

What is the purpose of >>> 3?

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
Alex Garrett
  • 155
  • 1
  • 9
  • 1
    https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Unsigned_right_shift – Andy Sep 03 '14 at 14:12
  • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators – Dave Newton Sep 03 '14 at 14:13
  • [Some more info here](http://stackoverflow.com/questions/19077902/bitwise-operation-zero-fill-right-shift-usages) – Andy Sep 03 '14 at 14:14

1 Answers1

0

This is the Zero-fill right shift bitwise operator.

From the Mozilla Developer Network docs:

This operator shifts the first operand the specified number of bits to the right. Excess bits shifted off to the right are discarded. Zero bits are shifted in from the left. The sign bit becomes 0, so the result is always non-negative.

maxdeviant
  • 1,161
  • 9
  • 10