title: What does an overflow means exactly?
body: <p>I have read two definitions for what an overflow means.</p>
  
  <p>Say that we have the following addition:</p>
  
  <pre><code> 11111111
   00000001
   --------
  100000000
  </code></pre>
  
  <p>The first definition I have read is that the fact that the result did not fit into 8 bits (it needed 9 bits in this example), then this is called an overflow.</p>
  
  <hr>
  
  <p>The other definition I have read is that if we have an addition for two signed integers (two's complement integers for example):</p>
  
  <pre><code> 10011001
   10111011
   --------
  101010100
  </code></pre>
  
  <p>Then if the 8 bits result (<code>01010100</code>) have a sign that is different from the sign for the two integers (and it is different in this example), then this is called an overflow.</p>
  
  <p>Which definition is correct?</p>