Averages/Arithmetic mean: Difference between revisions

Undo revision 29033 by 99.136.216.62 (Talk) (Vandalism.)
(Undo revision 29033 by 99.136.216.62 (Talk) (Vandalism.))
Line 154:
static double avg(ICollection<int> i)
{
if (i.Count == 0 || i == null) return 0; // <-- nice bug you introduced there Guga360
return i.Sum() / (double)i.Count;
}
Anonymous user