maxOrNull

Common
JVM
JS
Native
1.4
fun Array<out Double>.maxOrNull(): Double?
(source)
fun Array<out Float>.maxOrNull(): Float?
(source)
fun FloatArray.maxOrNull(): Float?
(source)
fun DoubleArray.maxOrNull(): Double?
(source)
fun Iterable<Double>.maxOrNull(): Double?
(source)
fun Iterable<Float>.maxOrNull(): Float?
(source)

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

If any of elements is NaN returns NaN.

Common
JVM
JS
Native
1.4
fun <T : Comparable<T>> Array<out T>.maxOrNull(): T?
(source)
fun ByteArray.maxOrNull(): Byte?
(source)
fun ShortArray.maxOrNull(): Short?
(source)
fun IntArray.maxOrNull(): Int?
(source)
fun LongArray.maxOrNull(): Long?
(source)
fun CharArray.maxOrNull(): Char?
(source)
fun <T : Comparable<T>> Iterable<T>.maxOrNull(): T?
(source)
@ExperimentalUnsignedTypes fun UIntArray.maxOrNull(): UInt?
(source)
@ExperimentalUnsignedTypes fun ULongArray.maxOrNull(): ULong?
(source)
@ExperimentalUnsignedTypes fun UByteArray.maxOrNull(): UByte?
(source)
@ExperimentalUnsignedTypes fun UShortArray.maxOrNull(): UShort?
(source)

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