W3cubDocs

/Kotlin

minOf

Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1)
fun <T : Comparable<T>> minOf(a: T, b: T): T

Returns the smaller of two values. If values are equal, returns the first one.

Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1)
fun minOf(a: Byte, b: Byte): Byte
fun minOf(a: Short, b: Short): Short
fun minOf(a: Int, b: Int): Int
fun minOf(a: Long, b: Long): Long
fun minOf(a: Float, b: Float): Float
fun minOf(a: Double, b: Double): Double

Returns the smaller of two values.

Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1)
fun <T : Comparable<T>> minOf(a: T, b: T, c: T): T
fun minOf(a: Byte, b: Byte, c: Byte): Byte
fun minOf(a: Short, b: Short, c: Short): Short
fun minOf(a: Int, b: Int, c: Int): Int
fun minOf(a: Long, b: Long, c: Long): Long
fun minOf(a: Float, b: Float, c: Float): Float
fun minOf(a: Double, b: Double, c: Double): Double

Returns the smaller of three values.

Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1)
fun <T> minOf(
    a: T, 
    b: T, 
    c: T, 
    comparator: Comparator<in T>
): T

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

Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1)
fun <T> minOf(a: T, b: T, comparator: Comparator<in T>): T

Returns the smaller of two values according to the order specified by the given comparator. If values are equal, returns the first one.

Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
@ExperimentalUnsignedTypes fun minOf(a: UInt, b: UInt): UInt
@ExperimentalUnsignedTypes fun minOf(
    a: ULong, 
    b: ULong
): ULong
@ExperimentalUnsignedTypes fun minOf(
    a: UByte, 
    b: UByte
): UByte
@ExperimentalUnsignedTypes fun minOf(
    a: UShort, 
    b: UShort
): UShort

Returns the smaller of two values.

Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
@ExperimentalUnsignedTypes fun minOf(
    a: UInt, 
    b: UInt, 
    c: UInt
): UInt
@ExperimentalUnsignedTypes fun minOf(
    a: ULong, 
    b: ULong, 
    c: ULong
): ULong
@ExperimentalUnsignedTypes fun minOf(
    a: UByte, 
    b: UByte, 
    c: UByte
): UByte
@ExperimentalUnsignedTypes fun minOf(
    a: UShort, 
    b: UShort, 
    c: UShort
): UShort

Returns the smaller of three values.

© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.comparisons/min-of.html