W3cubDocs

/Kotlin

max

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun Array<out Double>.max(): Double?
fun Array<out Float>.max(): Float?
fun FloatArray.max(): Float?
fun DoubleArray.max(): Double?
fun Iterable<Double>.max(): Double?
fun Iterable<Float>.max(): Float?

Returns the largest element or null if there are no elements.

If any of elements is NaN returns NaN.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun <T : Comparable<T>> Array<out T>.max(): T?
fun ByteArray.max(): Byte?
fun ShortArray.max(): Short?
fun IntArray.max(): Int?
fun LongArray.max(): Long?
fun CharArray.max(): Char?
fun <T : Comparable<T>> Iterable<T>.max(): T?
@ExperimentalUnsignedTypes fun UIntArray.max(): UInt?
@ExperimentalUnsignedTypes fun ULongArray.max(): ULong?
@ExperimentalUnsignedTypes fun UByteArray.max(): UByte?
@ExperimentalUnsignedTypes fun UShortArray.max(): UShort?

Returns the largest element or null if there are no elements.

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