min

@JvmName(name = "minOrThrow")
fun Array<out Double>.min(): Double(source)
@JvmName(name = "minOrThrow")
fun Array<out Float>.min(): Float(source)
@JvmName(name = "minOrThrow")
fun FloatArray.min(): Float(source)
@JvmName(name = "minOrThrow")
fun DoubleArray.min(): Double(source)

Returns the smallest element.

If any of elements is NaN returns NaN.

Since Kotlin

1.7

Throws

if the array is empty.


@JvmName(name = "minOrThrow")
fun <T : Comparable<T>> Array<out T>.min(): T(source)
@JvmName(name = "minOrThrow")
fun ByteArray.min(): Byte(source)
@JvmName(name = "minOrThrow")
fun ShortArray.min(): Short(source)
@JvmName(name = "minOrThrow")
fun IntArray.min(): Int(source)
@JvmName(name = "minOrThrow")
fun LongArray.min(): Long(source)
@JvmName(name = "minOrThrow")
fun CharArray.min(): Char(source)
@JvmName(name = "minOrThrow-U")
fun UIntArray.min(): UInt(source)

Returns the smallest element.

Since Kotlin

1.7

Throws

if the array is empty.


@JvmName(name = "minOrThrow")
fun Iterable<Double>.min(): Double(source)
@JvmName(name = "minOrThrow")
fun Iterable<Float>.min(): Float(source)

Returns the smallest element.

If any of elements is NaN returns NaN.

Since Kotlin

1.7

Throws

if the collection is empty.


@JvmName(name = "minOrThrow")
fun <T : Comparable<T>> Iterable<T>.min(): T(source)

Returns the smallest element.

Since Kotlin

1.7

Throws

if the collection is empty.

Deprecated

Warning since 1.4

Error since 1.5

Hidden since 1.6

Use minOrNull instead.

Replace with

this.minOrNull()

Since Kotlin

1.1

fun <T : Comparable<T>> Array<out T>.min(): T?(source)
fun <T : Comparable<T>> Iterable<T>.min(): T?(source)

Deprecated

Warning since 1.4

Error since 1.5

Hidden since 1.6

Use minOrNull instead.

Replace with

this.minOrNull()

Since Kotlin

1.0

Deprecated

Warning since 1.4

Error since 1.5

Hidden since 1.6

Use minOrNull instead.

Replace with

this.minOrNull()

Since Kotlin

1.3