minOf

Common
JVM
JS
Native
1.1

Returns the smaller of two values.

If values are equal, returns the first one.

Common
JVM
JS
Native
1.1
fun minOf(a: Byte, b: Byte): Byte
(Common source) (JVM source) (JS source) (Native source)
fun minOf(a: Short, b: Short): Short
(Common source) (JVM source) (JS source) (Native source)
fun minOf(a: Long, b: Long): Long
(Common source) (JVM source) (JS source) (Native source)

Returns the smaller of two values.

Common
JVM
JS
Native
1.1
fun minOf(a: Float, b: Float): Float
(Common source) (JVM source) (JS source) (Native source)
fun minOf(a: Double, b: Double): Double
(Common source) (JVM source) (JS source) (Native source)

Returns the smaller of two values.

If either value is NaN, returns NaN.

Common
JVM
JS
Native
1.1
fun <T : Comparable<T>> minOf(a: T, b: T, c: T): T
(Common source) (JVM source) (JS source) (Native source)

Returns the smaller of three values.

If there are multiple equal minimal values, returns the first of them.

Common
JVM
JS
Native
1.1
fun minOf(a: Byte, b: Byte, c: Byte): Byte
(Common source) (JVM source) (JS source) (Native source)
fun minOf(a: Short, b: Short, c: Short): Short
(Common source) (JVM source) (JS source) (Native source)
fun minOf(a: Int, b: Int, c: Int): Int
(Common source) (JVM source) (JS source) (Native source)
fun minOf(a: Long, b: Long, c: Long): Long
(Common source) (JVM source) (JS source) (Native source)

Returns the smaller of three values.

Common
JVM
JS
Native
1.1
fun minOf(a: Float, b: Float, c: Float): Float
(Common source) (JVM source) (JS source) (Native source)
fun minOf(a: Double, b: Double, c: Double): Double
(Common source) (JVM source) (JS source) (Native source)

Returns the smaller of three values.

If any value is NaN, returns NaN.

Common
JVM
JS
Native
1.1
fun <T> minOf(
    a: T,
    b: T,
    c: T,
    comparator: Comparator<in T>
): T

(source)

Returns the smaller of three values according to the order specified by the given comparator.

If there are multiple equal minimal values, returns the first of them.

Common
JVM
JS
Native
1.1
fun <T> minOf(a: T, b: T, comparator: Comparator<in T>): T
(source)

Returns the smaller of two values according to the order specified by the given comparator.

If values are equal, returns the first one.

Common
JVM
JS
Native
1.4
fun <T : Comparable<T>> minOf(a: T, vararg other: T): T
(Common source) (JVM source) (JS source) (Native source)

Returns the smaller of the given values.

If there are multiple equal minimal values, returns the first of them.

Common
JVM
JS
Native
1.4
fun minOf(a: Byte, vararg other: Byte): Byte
(Common source) (JVM source) (JS source) (Native source)
fun minOf(a: Short, vararg other: Short): Short
(Common source) (JVM source) (JS source) (Native source)
fun minOf(a: Int, vararg other: Int): Int
(Common source) (JVM source) (JS source) (Native source)
fun minOf(a: Long, vararg other: Long): Long
(Common source) (JVM source) (JS source) (Native source)

Returns the smaller of the given values.

Common
JVM
JS
Native
1.4
fun minOf(a: Float, vararg other: Float): Float
(Common source) (JVM source) (JS source) (Native source)
fun minOf(a: Double, vararg other: Double): Double
(Common source) (JVM source) (JS source) (Native source)

Returns the smaller of the given values.

If any value is NaN, returns NaN.

Common
JVM
JS
Native
1.4
fun <T> minOf(
    a: T,
    vararg other: T,
    comparator: Comparator<in T>
): T

(source)

Returns the smaller of the given values according to the order specified by the given comparator.

If there are multiple equal minimal values, returns the first of them.

Common
JVM
JS
Native
1.5
fun minOf(a: UInt, b: UInt): UInt
(source)
fun minOf(a: ULong, b: ULong): ULong
(source)
fun minOf(a: UByte, b: UByte): UByte
(source)
fun minOf(a: UShort, b: UShort): UShort
(source)

Returns the smaller of two values.

Common
JVM
JS
Native
1.5
fun minOf(a: UInt, b: UInt, c: UInt): UInt
(source)
fun minOf(a: ULong, b: ULong, c: ULong): ULong
(source)
fun minOf(a: UByte, b: UByte, c: UByte): UByte
(source)
fun minOf(a: UShort, b: UShort, c: UShort): UShort
(source)

Returns the smaller of three values.

Common
JVM
JS
Native
1.4
@ExperimentalUnsignedTypes fun minOf(
    a: UInt,
    vararg other: UInt
): UInt

(source)
@ExperimentalUnsignedTypes fun minOf(
    a: ULong,
    vararg other: ULong
): ULong

(source)
@ExperimentalUnsignedTypes fun minOf(
    a: UByte,
    vararg other: UByte
): UByte

(source)
@ExperimentalUnsignedTypes fun minOf(
    a: UShort,
    vararg other: UShort
): UShort

(source)

Returns the smaller of the given values.