title: Midpoint Formula Overflow Error
body: <p>I'm learning algorithms/big o and i was just curious about this.</p>
  
  <p>The use of</p>
  
  <pre><code> mid = (low+high)/2;
  </code></pre>
  
  <p>in order to get the midpoint for a binary search algorithm is generally discouraged because of the possibility of an overflow error. Why would this cause an overflow error to occur, and how does </p>
  
  <pre><code> mid = low + (high-low)/2;
  </code></pre>
  
  <p>prevent this error?</p>
  
  <p>Thanks.</p>