maxOfOrNull

Common
JVM
JS
Native
1.4
inline fun <T> Array<out T>.maxOfOrNull(
    selector: (T) -> Double
): Double?
inline fun ByteArray.maxOfOrNull(
    selector: (Byte) -> Double
): Double?
inline fun ShortArray.maxOfOrNull(
    selector: (Short) -> Double
): Double?
inline fun IntArray.maxOfOrNull(
    selector: (Int) -> Double
): Double?
inline fun LongArray.maxOfOrNull(
    selector: (Long) -> Double
): Double?
inline fun FloatArray.maxOfOrNull(
    selector: (Float) -> Double
): Double?
inline fun DoubleArray.maxOfOrNull(
    selector: (Double) -> Double
): Double?
inline fun BooleanArray.maxOfOrNull(
    selector: (Boolean) -> Double
): Double?
inline fun CharArray.maxOfOrNull(
    selector: (Char) -> Double
): Double?
inline fun <T> Array<out T>.maxOfOrNull(
    selector: (T) -> Float
): Float?
inline fun ByteArray.maxOfOrNull(
    selector: (Byte) -> Float
): Float?
inline fun ShortArray.maxOfOrNull(
    selector: (Short) -> Float
): Float?
inline fun IntArray.maxOfOrNull(
    selector: (Int) -> Float
): Float?
inline fun LongArray.maxOfOrNull(
    selector: (Long) -> Float
): Float?
inline fun FloatArray.maxOfOrNull(
    selector: (Float) -> Float
): Float?
inline fun DoubleArray.maxOfOrNull(
    selector: (Double) -> Float
): Float?
inline fun BooleanArray.maxOfOrNull(
    selector: (Boolean) -> Float
): Float?
inline fun CharArray.maxOfOrNull(
    selector: (Char) -> Float
): Float?
@ExperimentalUnsignedTypes inline fun UIntArray.maxOfOrNull(
    selector: (UInt) -> Double
): Double?
@ExperimentalUnsignedTypes inline fun ULongArray.maxOfOrNull(
    selector: (ULong) -> Double
): Double?
@ExperimentalUnsignedTypes inline fun UByteArray.maxOfOrNull(
    selector: (UByte) -> Double
): Double?
@ExperimentalUnsignedTypes inline fun UShortArray.maxOfOrNull(
    selector: (UShort) -> Double
): Double?
@ExperimentalUnsignedTypes inline fun UIntArray.maxOfOrNull(
    selector: (UInt) -> Float
): Float?
@ExperimentalUnsignedTypes inline fun ULongArray.maxOfOrNull(
    selector: (ULong) -> Float
): Float?
@ExperimentalUnsignedTypes inline fun UByteArray.maxOfOrNull(
    selector: (UByte) -> Float
): Float?
@ExperimentalUnsignedTypes inline fun UShortArray.maxOfOrNull(
    selector: (UShort) -> Float
): Float?

Returns the largest value among all values produced by selector function applied to each element in the array or null if there are no elements.

If any of values produced by selector function is NaN, the returned result is NaN.

Common
JVM
JS
Native
1.4
inline fun <T, R : Comparable<R>> Array<out T>.maxOfOrNull(
    selector: (T) -> R
): R?
inline fun <R : Comparable<R>> ByteArray.maxOfOrNull(
    selector: (Byte) -> R
): R?
inline fun <R : Comparable<R>> ShortArray.maxOfOrNull(
    selector: (Short) -> R
): R?
inline fun <R : Comparable<R>> IntArray.maxOfOrNull(
    selector: (Int) -> R
): R?
inline fun <R : Comparable<R>> LongArray.maxOfOrNull(
    selector: (Long) -> R
): R?
inline fun <R : Comparable<R>> FloatArray.maxOfOrNull(
    selector: (Float) -> R
): R?
inline fun <R : Comparable<R>> DoubleArray.maxOfOrNull(
    selector: (Double) -> R
): R?
inline fun <R : Comparable<R>> BooleanArray.maxOfOrNull(
    selector: (Boolean) -> R
): R?
inline fun <R : Comparable<R>> CharArray.maxOfOrNull(
    selector: (Char) -> R
): R?
@ExperimentalUnsignedTypes inline fun <R : Comparable<R>> UIntArray.maxOfOrNull(
    selector: (UInt) -> R
): R?
@ExperimentalUnsignedTypes inline fun <R : Comparable<R>> ULongArray.maxOfOrNull(
    selector: (ULong) -> R
): R?
@ExperimentalUnsignedTypes inline fun <R : Comparable<R>> UByteArray.maxOfOrNull(
    selector: (UByte) -> R
): R?
@ExperimentalUnsignedTypes inline fun <R : Comparable<R>> UShortArray.maxOfOrNull(
    selector: (UShort) -> R
): R?

Returns the largest value among all values produced by selector function applied to each element in the array or null if there are no elements.

Common
JVM
JS
Native
1.4
inline fun <T> Iterable<T>.maxOfOrNull(
    selector: (T) -> Double
): Double?
inline fun <T> Iterable<T>.maxOfOrNull(
    selector: (T) -> Float
): Float?

Returns the largest value among all values produced by selector function applied to each element in the collection or null if there are no elements.

If any of values produced by selector function is NaN, the returned result is NaN.

Common
JVM
JS
Native
1.4
inline fun <T, R : Comparable<R>> Iterable<T>.maxOfOrNull(
    selector: (T) -> R
): R?

Returns the largest value among all values produced by selector function applied to each element in the collection or null if there are no elements.

Common
JVM
JS
Native
1.4
inline fun <K, V> Map<out K, V>.maxOfOrNull(
    selector: (Entry<K, V>) -> Double
): Double?
inline fun <K, V> Map<out K, V>.maxOfOrNull(
    selector: (Entry<K, V>) -> Float
): Float?

Returns the largest value among all values produced by selector function applied to each entry in the map or null if there are no entries.

If any of values produced by selector function is NaN, the returned result is NaN.

Common
JVM
JS
Native
1.4
inline fun <K, V, R : Comparable<R>> Map<out K, V>.maxOfOrNull(
    selector: (Entry<K, V>) -> R
): R?

Returns the largest value among all values produced by selector function applied to each entry in the map or null if there are no entries.