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
@JvmName("sumOfUInt") fun Array<out UInt>.sum(): UInt
@JvmName("sumOfULong") fun Array<out ULong>.sum(): ULong
@JvmName("sumOfUByte") fun Array<out UByte>.sum(): UInt
@JvmName("sumOfUShort") fun Array<out UShort>.sum(): UInt
fun UIntArray.sum(): UInt
fun ULongArray.sum(): ULong
fun UByteArray.sum(): UInt
fun UShortArray.sum(): UInt

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
@JvmName("sumOfUInt") fun Iterable<UInt>.sum(): UInt
@JvmName("sumOfULong") fun Iterable<ULong>.sum(): ULong
@JvmName("sumOfUByte") fun Iterable<UByte>.sum(): UInt
@JvmName("sumOfUShort") fun Iterable<UShort>.sum(): UInt

Returns the sum of all elements in the collection.