title: calculate maximum value possible from a given number of bits
body: <p>I have a function which will need to be passed an arbitrary number of bits, for example 7. Is there a straitforward way to calculate the largest number available with that number of bits. Eg, if I passed in 8, the function would return 255. </p>
  
  <p>Is there a straightforward/effieicnt way to do this? </p>