.NET Framework 3.5. I\'m trying to calculate the average of some pretty large numbers. For instance:
using System; using System.Linq; class Program {
Here is my version of an extension method that can help with this.
public static long Average(this IEnumerable longs) { long mean = 0; long count = longs.Count(); foreach (var val in longs) { mean += val / count; } return mean; }