-3

I know >> is Binary Right Shift Operator but what does >>= mean, like if I want Log2 on x I need while(x >>= 1) result++;.

Mano Mini
  • 607
  • 4
  • 15

1 Answers1

2

It's the bitwise shift right assignment operator; x >>= 1 is equivalent to x = x >> 1.

(It has the same precedence as assignment =).

Bathsheba
  • 231,907
  • 34
  • 361
  • 483