sum<T extends num> function

T sum<T extends num>(
  1. List<T> l
)

Implementation

T sum<T extends num>(List<T> l) {
  if (l.isEmpty) {
    return 0.0 as T;
  }

  return l.reduce((acc, val) => (acc).toDouble() + (val).toDouble() as T);
}