sum

Common
JVM
JS
Native
1.0
@JvmName("sumOfByte") fun Sequence<Byte>.sum(): Int
@JvmName("sumOfShort") fun Sequence<Short>.sum(): Int
@JvmName("sumOfInt") fun Sequence<Int>.sum(): Int
@JvmName("sumOfLong") fun Sequence<Long>.sum(): Long
@JvmName("sumOfFloat") fun Sequence<Float>.sum(): Float
@JvmName("sumOfDouble") fun Sequence<Double>.sum(): Double
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes fun Sequence<UInt>.sum(): UInt
@JvmName("sumOfULong") @ExperimentalUnsignedTypes fun Sequence<ULong>.sum(): ULong
@JvmName("sumOfUByte") @ExperimentalUnsignedTypes fun Sequence<UByte>.sum(): UInt
@JvmName("sumOfUShort") @ExperimentalUnsignedTypes fun Sequence<UShort>.sum(): UInt

Returns the sum of all elements in the sequence.

The operation is terminal.