sum method
Implementation
double sum(DoubleSelector selector) =>
fold(0.0, (previousValue, element) => previousValue + selector(element));
double sum(DoubleSelector selector) =>
fold(0.0, (previousValue, element) => previousValue + selector(element));