title: Is it true that the amount of necessary binary digits for any given positive integer is ceil( log_2 n)?
body: <p>Title pretty much says it. I can only guess but I have no proof that this holds. In Python <code>math.ceil(math.log(n) / math.log(2))</code>. </p>
  
  <p>Context: I'm creating a intbyte-to-char*binary function which only displays the necessary digits (id est no trailing zeros), thus I would need to dynamically allocate memory for the char array. However I assume there exists an upper bound which I could use to determine the length statically.</p>
  
  <p><strong>Edit</strong>: It seems my approach was wrong. To check the amount of digits necessary, it is way faster just to divide the number by 2 successively until it is 0 and keep track of the amount of divisions.</p>