package kotlin // // NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt // See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib // import java.util.* /** * Returns the sum of all elements in the collection */ public fun Iterable.sum(): Int { val iterator = iterator() var sum: Int = 0 while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun Iterable.sum(): Long { val iterator = iterator() var sum: Long = 0 while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun Iterable.sum(): Double { val iterator = iterator() var sum: Double = 0.0 while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun Iterable.sum(): Float { val iterator = iterator() var sum: Float = 0.0f while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun Array.sum(): Int { val iterator = iterator() var sum: Int = 0 while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun IntArray.sum(): Int { val iterator = iterator() var sum: Int = 0 while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun Array.sum(): Long { val iterator = iterator() var sum: Long = 0 while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun LongArray.sum(): Long { val iterator = iterator() var sum: Long = 0 while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun Array.sum(): Int { val iterator = iterator() var sum: Int = 0 while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun ByteArray.sum(): Int { val iterator = iterator() var sum: Int = 0 while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun Array.sum(): Int { val iterator = iterator() var sum: Int = 0 while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun ShortArray.sum(): Int { val iterator = iterator() var sum: Int = 0 while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun Array.sum(): Double { val iterator = iterator() var sum: Double = 0.0 while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun DoubleArray.sum(): Double { val iterator = iterator() var sum: Double = 0.0 while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun Array.sum(): Float { val iterator = iterator() var sum: Float = 0.0f while (iterator.hasNext()) { sum += iterator.next() } return sum } /** * Returns the sum of all elements in the collection */ public fun FloatArray.sum(): Float { val iterator = iterator() var sum: Float = 0.0f while (iterator.hasNext()) { sum += iterator.next() } return sum }