W3cubDocs

/Kotlin

average

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
@JvmName("averageOfByte") fun Array<out Byte>.average(): Double
@JvmName("averageOfShort") fun Array<out Short>.average(): Double
@JvmName("averageOfInt") fun Array<out Int>.average(): Double
@JvmName("averageOfLong") fun Array<out Long>.average(): Double
@JvmName("averageOfFloat") fun Array<out Float>.average(): Double
@JvmName("averageOfDouble") fun Array<out Double>.average(): Double
fun ByteArray.average(): Double
fun ShortArray.average(): Double
fun IntArray.average(): Double
fun LongArray.average(): Double
fun FloatArray.average(): Double
fun DoubleArray.average(): Double

Returns an average value of elements in the array.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
@JvmName("averageOfByte") fun Iterable<Byte>.average(): Double
@JvmName("averageOfShort") fun Iterable<Short>.average(): Double
@JvmName("averageOfInt") fun Iterable<Int>.average(): Double
@JvmName("averageOfLong") fun Iterable<Long>.average(): Double
@JvmName("averageOfFloat") fun Iterable<Float>.average(): Double
@JvmName("averageOfDouble") fun Iterable<Double>.average(): Double

Returns an average value of elements in the collection.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/average.html