Averages/Arithmetic mean: Difference between revisions
Content deleted Content added
fixed |
|||
Line 154: | Line 154: | ||
static double avg(ICollection<int> i) |
static double avg(ICollection<int> i) |
||
{ |
{ |
||
if (i.Count == 0 || i == null) return 0; |
if (i.Count == 0 || i == null) return 0; // <-- nice bug you introduced there Guga360 |
||
return i.Sum() / (double)i.Count; |
return i.Sum() / (double)i.Count; |
||
} |
} |