title: How to convert decimal to Variable Byte code & gamma code
body: <h3>How do you convert the decimal number 777 to the equivalent VB &amp; gamma codes?</h3>
  <p>I've been <a href="http://nlp.stanford.edu/IR-book/html/htmledition/gamma-codes-1.html" rel="noreferrer">reading up</a> on gamma codes. I see where they get the unary codes from the decimal but not where the length &amp; offset comes from. I also understand that the gamma code is just the length (of the unary code) concatenated with the offset.</p>