Average (mean) of numbers.
double listAverage(Iterable<num> it) { if (it.isEmpty) { return 0; } num result = 0; for (num n in it) { result += n; } return result / it.length; }