title: Enumerable.Average and OverflowException
body: <p>Perhaps a useless question: </p>
  
  <pre><code>public static double Average&lt;TSource&gt;(
      this IEnumerable&lt;TSource&gt; source,
      Func&lt;TSource, int&gt; selector
  )
  </code></pre>
  
  <p>One of exceptions thrown by the above method is also <em>OverflowException: The sum of the elements in the sequence is larger than Int64.MaxValue.</em></p>
  
  <p>I assume reason for this exception is that sum of the averaged values is computed using variable <strong>S</strong> of type <code>long</code>? But since return value is of type <code>double</code>, why didn't designers choose to make <strong>S</strong> also of type <code>double</code>? </p>
  
  <p>Thank you</p>