title: Time complexity and integer inputs
body: <p>I came across a question asking to describe the computational complexity in Big O of the following code:</p>
  
  <pre><code>i = 1;
  while(i &lt; N) {
      i = i * 2;
  }
  </code></pre>
  
  <p>I found <a href="https://stackoverflow.com/questions/40066016/is-time-complexity-on-or-olog-n">this</a> Stack Overflow question asking for the answer, with the most voted answer saying it is Log2(N).</p>
  
  <p>On first thought that answer looks correct, however I remember learning about psuedo polynomial runtimes, and how computational complexity measures difficulty with respect to the length of the input, rather than the value.</p>
  
  <p>So for integer inputs, the complexity should be in terms of the number of bits in the input.</p>
  
  <p>Therefore, shouldn't this function be O(N)? Because every iteration of the loop increases the number of bits in i by 1, until it reaches around the same bits as N. </p>