sumOf

inline fun <T> Iterable<T>.sumOf(selector: (T) -> Int): Int(source)

Sums selector once per element in iteration order, returning Int zero when empty. No collection is allocated; selector/iterator exceptions and inline non-local returns propagate. Addition uses ordinary wrapping Int arithmetic.


inline fun <T> Iterable<T>.sumOf(selector: (T) -> Long): Long(source)

Sums selector once per element in iteration order, returning Long zero when empty. No collection is allocated; selector/iterator exceptions and inline non-local returns propagate. Addition uses ordinary wrapping Long arithmetic.


inline fun <T> Iterable<T>.sumOf(selector: (T) -> Double): Double(source)

Sums selector once per element in iteration order, returning Double zero when empty. No collection is allocated; selector/iterator exceptions and inline non-local returns propagate. Addition retains ordinary Double rounding, infinities and NaN.


inline fun <T> Iterable<T>.sumOf(selector: (T) -> UInt): UInt(source)

Sums selector once per element in iteration order, returning UInt zero when empty. No collection is allocated; selector/iterator exceptions and inline non-local returns propagate. Addition uses ordinary wrapping UInt arithmetic.


inline fun <T> Iterable<T>.sumOf(selector: (T) -> ULong): ULong(source)

Sums selector once per element in iteration order, returning ULong zero when empty. No collection is allocated; selector/iterator exceptions and inline non-local returns propagate. Addition uses ordinary wrapping ULong arithmetic.