title: byte + byte = int... why?
body: <p>Looking at this C# code:</p>
  
  <pre><code>byte x = 1;
  byte y = 2;
  byte z = x + y; // ERROR: Cannot implicitly convert type 'int' to 'byte'
  </code></pre>
  
  <p>The result of any math performed on <code>byte</code> (or <code>short</code>) types is implicitly cast back to an integer. The solution is to explicitly cast the result back to a byte:</p>
  
  <pre><code>byte z = (byte)(x + y); // this works
  </code></pre>
  
  <p>What I am wondering is why? Is it architectural? Philosophical?</p>
  
  <p><strong>We have:</strong></p>
  
  <ul>
  <li><code>int</code> + <code>int</code> = <code>int</code></li>
  <li><code>long</code> + <code>long</code> = <code>long</code></li>
  <li><code>float</code> + <code>float</code> = <code>float</code></li>
  <li><code>double</code> + <code>double</code> = <code>double</code></li>
  </ul>
  
  <p><strong>So why not:</strong></p>
  
  <ul>
  <li><code>byte</code> + <code>byte</code> = <code>byte</code></li>
  <li><code>short</code> + <code>short</code> = <code>short</code>?</li>
  </ul>
  
  <p>A bit of background: I am performing a long list of calculations on "small numbers" (i.e. &lt; 8) and storing the intermediate results in a large array. Using a <em>byte array</em> (instead of an int array) <em>is faster</em> (because of cache hits). But the extensive byte-casts spread through the code make it that much more unreadable.</p>