W3cubDocs

/Kotlin

sum

@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

Returns the sum of all elements in the sequence.

The operation is terminal.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/sum.html