Today I discovered a surprising C# limitation: apparently (as of .Net 3.5) numeric types in C# do not share common super class. I believe that this feature would come quite handy in cases like mine. My goal was to write a function that calculates average value of some numeric collection without taking into account top 10% and bottom 10%. So the code I came up with was: public static double AverageWithoutExtremeValues(List<double> values) { values.Sort(); return values.Skip((int)Math.Round(values.Count * 0.1)) .Take((int)Math.Round(values.Count * [ Read More ]
Continue