Mean value of ns entries.
ns
static double mean(Iterable<num> ns) { if (ns.isEmpty) return 0; return sum(ns) / ns.length; }