title: Previous power of 2
body: <p>There is a lot of information on how to find the next power of 2 of a given value (see refs) but I cannot find any to get the previous power of two.</p>
  
  <p>The only way I find so far is to keep a table with all power of two up to 2^64 and make a simple lookup.</p>
  
  <ul>
  <li><a href="http://acius2.blogspot.com/2007/11/calculating-next-power-of-2.html" rel="noreferrer">Acius' Snippets</a></li>
  <li><a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=229831" rel="noreferrer">gamedev</a></li>
  <li><a href="http://graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightMultLookup" rel="noreferrer">Bit Twiddling Hacks</a></li>
  <li><a href="https://stackoverflow.com/questions/364985/algorithm-for-finding-the-smallest-power-of-two-thats-greater-or-equal-to-a-give">Stack Overflow</a></li>
  </ul>