All Downloads are FREE. Search and download functionalities are using the official Maven repository.

generated._Numeric.kt Maven / Gradle / Ivy

There is a newer version: 2.1.0-Beta1
Show newest version
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
    
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy