max Of
Returns the largest value among all values produced by selector function applied to each element in the array.
If any of values produced by selector function is NaN
, the returned result is NaN
.
Since Kotlin
1.4
Throws
if the array is empty.
inline fun <T, R : Comparable<R>> Array<out T>.maxOf(selector: (T) -> R): R
Content copied to clipboard
inline fun <R : Comparable<R>> ShortArray.maxOf(selector: (Short) -> R): R
Content copied to clipboard
inline fun <R : Comparable<R>> FloatArray.maxOf(selector: (Float) -> R): R
Content copied to clipboard
inline fun <R : Comparable<R>> DoubleArray.maxOf(selector: (Double) -> R): R
Content copied to clipboard
inline fun <R : Comparable<R>> BooleanArray.maxOf(selector: (Boolean) -> R): R
Content copied to clipboard
inline fun <R : Comparable<R>> ULongArray.maxOf(selector: (ULong) -> R): R
Content copied to clipboard
inline fun <R : Comparable<R>> UByteArray.maxOf(selector: (UByte) -> R): R
Content copied to clipboard
inline fun <R : Comparable<R>> UShortArray.maxOf(selector: (UShort) -> R): R
Content copied to clipboard
Returns the largest value among all values produced by selector function applied to each element in the array.
Since Kotlin
1.4
Throws
if the array is empty.
Returns the largest value among all values produced by selector function applied to each element in the collection.
If any of values produced by selector function is NaN
, the returned result is NaN
.
Since Kotlin
1.4
Throws
if the collection is empty.
Returns the largest value among all values produced by selector function applied to each element in the collection.
Since Kotlin
1.4
Throws
if the collection is empty.