minOf

inline fun <T> Array<out T>.minOf(selector: (T) -> Double): Double(source)
inline fun ByteArray.minOf(selector: (Byte) -> Double): Double(source)
inline fun ShortArray.minOf(selector: (Short) -> Double): Double(source)
inline fun IntArray.minOf(selector: (Int) -> Double): Double(source)
inline fun LongArray.minOf(selector: (Long) -> Double): Double(source)
inline fun FloatArray.minOf(selector: (Float) -> Double): Double(source)
inline fun DoubleArray.minOf(selector: (Double) -> Double): Double(source)
inline fun BooleanArray.minOf(selector: (Boolean) -> Double): Double(source)
inline fun CharArray.minOf(selector: (Char) -> Double): Double(source)
inline fun <T> Array<out T>.minOf(selector: (T) -> Float): Float(source)
inline fun ByteArray.minOf(selector: (Byte) -> Float): Float(source)
inline fun ShortArray.minOf(selector: (Short) -> Float): Float(source)
inline fun IntArray.minOf(selector: (Int) -> Float): Float(source)
inline fun LongArray.minOf(selector: (Long) -> Float): Float(source)
inline fun FloatArray.minOf(selector: (Float) -> Float): Float(source)
inline fun DoubleArray.minOf(selector: (Double) -> Float): Float(source)
inline fun BooleanArray.minOf(selector: (Boolean) -> Float): Float(source)
inline fun CharArray.minOf(selector: (Char) -> Float): Float(source)

Returns the smallest 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.

Samples


inline fun <T, R : Comparable<R>> Array<out T>.minOf(selector: (T) -> R): R(source)

Returns the smallest value among all values produced by selector function applied to each element in the array.

If multiple elements produce the minimal value, this function returns the first of those values.

Since Kotlin

1.4

Throws

if the array is empty.

Samples


inline fun <R : Comparable<R>> ByteArray.minOf(selector: (Byte) -> R): R(source)
inline fun <R : Comparable<R>> ShortArray.minOf(selector: (Short) -> R): R(source)
inline fun <R : Comparable<R>> IntArray.minOf(selector: (Int) -> R): R(source)
inline fun <R : Comparable<R>> LongArray.minOf(selector: (Long) -> R): R(source)
inline fun <R : Comparable<R>> FloatArray.minOf(selector: (Float) -> R): R(source)
inline fun <R : Comparable<R>> DoubleArray.minOf(selector: (Double) -> R): R(source)
inline fun <R : Comparable<R>> BooleanArray.minOf(selector: (Boolean) -> R): R(source)
inline fun <R : Comparable<R>> CharArray.minOf(selector: (Char) -> R): R(source)
inline fun <R : Comparable<R>> UIntArray.minOf(selector: (UInt) -> R): R(source)

Returns the smallest value among all values produced by selector function applied to each element in the array.

If multiple elements produce the minimal value, this function returns the first of those values.

Since Kotlin

1.4

Throws

if the array is empty.

Samples


inline fun <T> Iterable<T>.minOf(selector: (T) -> Double): Double(source)
inline fun <T> Iterable<T>.minOf(selector: (T) -> Float): Float(source)

Returns the smallest 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.

Samples


inline fun <T, R : Comparable<R>> Iterable<T>.minOf(selector: (T) -> R): R(source)

Returns the smallest value among all values produced by selector function applied to each element in the collection.

If multiple elements produce the minimal value, this function returns the first of those values.

Since Kotlin

1.4

Throws

if the collection is empty.

Samples


inline fun <K, V> Map<out K, V>.minOf(selector: (Map.Entry<K, V>) -> Double): Double(source)
inline fun <K, V> Map<out K, V>.minOf(selector: (Map.Entry<K, V>) -> Float): Float(source)

Returns the smallest value among all values produced by selector function applied to each entry in the map.

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

Since Kotlin

1.4

Throws

if the map is empty.

Samples


inline fun <K, V, R : Comparable<R>> Map<out K, V>.minOf(selector: (Map.Entry<K, V>) -> R): R(source)

Returns the smallest value among all values produced by selector function applied to each entry in the map.

If multiple entries produce the minimal value, this function returns the first of those values.

Since Kotlin

1.4

Throws

if the map is empty.

Samples