avgOfDouble method
Returns the average value of double values by elements.
getVal
should return value for calculate average.
It can be property of element, or any another value by element.
If no elements, return 0
.
Implementation
double avgOfDouble(GetValue<E, double> getVal) {
final count = length;
return count > 0 ? sumOfDouble(getVal) / count : 0;
}