title: Is there any fast algorithm to compute log2 for numbers that are all power of 2?
body: <p>Is there any fast algorithm to compute log2 for numbers that are all power of 2,eg:</p>
  
  <pre><code>log2(1), log2(2), log2(4), log2(1024), log2(4096)...
  </code></pre>
  
  <p>I'm considering using it to implement bit set iteration.</p>