sum

Common
JVM
JS
Native
1.0
@JvmName("sumOfByte") fun Array<out Byte>.sum(): Int
@JvmName("sumOfShort") fun Array<out Short>.sum(): Int
@JvmName("sumOfInt") fun Array<out Int>.sum(): Int
@JvmName("sumOfLong") fun Array<out Long>.sum(): Long
@JvmName("sumOfFloat") fun Array<out Float>.sum(): Float
@JvmName("sumOfDouble") fun Array<out Double>.sum(): Double
fun ByteArray.sum(): Int
fun ShortArray.sum(): Int
fun IntArray.sum(): Int
fun LongArray.sum(): Long
fun FloatArray.sum(): Float
fun DoubleArray.sum(): Double

Returns the sum of all elements in the array.

Common
JVM
JS
Native
1.0
@JvmName("sumOfByte") fun Iterable<Byte>.sum(): Int
@JvmName("sumOfShort") fun Iterable<Short>.sum(): Int
@JvmName("sumOfInt") fun Iterable<Int>.sum(): Int
@JvmName("sumOfLong") fun Iterable<Long>.sum(): Long
@JvmName("sumOfFloat") fun Iterable<Float>.sum(): Float
@JvmName("sumOfDouble") fun Iterable<Double>.sum(): Double

Returns the sum of all elements in the collection.