-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
  • 597
  • 3
  • 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
  • 227,678
  • 33
  • 352
  • 470