title: What do (n&(n-1))==0 and n&(n-1)==0 do in C++?
body: <p>What do <code>(n&amp;(n-1))==0</code> and <code>n&amp;(n-1)==0</code> do (<code>n</code> is an integer) in C++?</p>
  
  <pre><code>if ((n&amp;(n-1))==0)
  {
      // do something
  }
  
  if (n&amp;(n-1)==0)
  {
      // do something
  }
  </code></pre>