title: Java Bit Manipulation - What does (num >>= 1) do?
body: <p>I was looking at some code that outputs a number to the binary form with prepended 0s.</p>
  
  <pre><code>    byte number = 48;
      int i = 256; //max number * 2
      while( (i &gt;&gt;= 1) &gt; 0) {
          System.out.print(((number &amp; i) != 0 ? "1" : "0"));
      }
  </code></pre>
  
  <p>and didn't understand what the <code>i &gt;&gt;= 1</code> does. I know that <code>i &gt;&gt; 1</code> shifts to the right by 1 bit but didn't understand what the <code>=</code> does and as far as I know, it is not possible to do a search for ">>=" to find out what it means.</p>