maxOf

fun <T> maxOf(a: T, b: T, c: T, comparator: Comparator<in T>): T

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

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

Since Kotlin

1.1

fun <T> maxOf(a: T, b: T, comparator: Comparator<in T>): T

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

If values are equal, returns the first one.

Since Kotlin

1.1

fun <T> maxOf(a: T, vararg other: T, comparator: Comparator<in T>): T

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

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

Since Kotlin

1.4

fun maxOf(a: UInt, b: UInt): UInt
fun maxOf(a: ULong, b: ULong): ULong
fun maxOf(a: UByte, b: UByte): UByte
fun maxOf(a: UShort, b: UShort): UShort

Returns the greater of two values.

Since Kotlin

1.5

inline fun maxOf(a: UInt, b: UInt, c: UInt): UInt
inline fun maxOf(a: ULong, b: ULong, c: ULong): ULong
inline fun maxOf(a: UByte, b: UByte, c: UByte): UByte
inline fun maxOf(a: UShort, b: UShort, c: UShort): UShort

Returns the greater of three values.

Since Kotlin

1.5

fun maxOf(a: UInt, vararg other: UInt): UInt
fun maxOf(a: ULong, vararg other: ULong): ULong
fun maxOf(a: UByte, vararg other: UByte): UByte
fun maxOf(a: UShort, vararg other: UShort): UShort
expect fun maxOf(a: Byte, vararg other: Byte): Byte
expect fun maxOf(a: Short, vararg other: Short): Short
expect fun maxOf(a: Int, vararg other: Int): Int
expect fun maxOf(a: Long, vararg other: Long): Long

Returns the greater of the given values.

Since Kotlin

1.4

expect fun <T : Comparable<T>> maxOf(a: T, b: T): T

Returns the greater of two values.

If values are equal, returns the first one.

Since Kotlin

1.1

expect inline fun maxOf(a: Byte, b: Byte): Byte
expect inline fun maxOf(a: Short, b: Short): Short
expect inline fun maxOf(a: Int, b: Int): Int
expect inline fun maxOf(a: Long, b: Long): Long

Returns the greater of two values.

Since Kotlin

1.1

expect inline fun maxOf(a: Float, b: Float): Float
expect inline fun maxOf(a: Double, b: Double): Double

Returns the greater of two values.

If either value is NaN, returns NaN.

Since Kotlin

1.1

expect fun <T : Comparable<T>> maxOf(a: T, b: T, c: T): T

Returns the greater of three values.

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

Since Kotlin

1.1

expect inline fun maxOf(a: Byte, b: Byte, c: Byte): Byte
expect inline fun maxOf(a: Short, b: Short, c: Short): Short
expect inline fun maxOf(a: Int, b: Int, c: Int): Int
expect inline fun maxOf(a: Long, b: Long, c: Long): Long

Returns the greater of three values.

Since Kotlin

1.1

expect inline fun maxOf(a: Float, b: Float, c: Float): Float
expect inline fun maxOf(a: Double, b: Double, c: Double): Double

Returns the greater of three values.

If any value is NaN, returns NaN.

Since Kotlin

1.1

expect fun <T : Comparable<T>> maxOf(a: T, vararg other: T): T

Returns the greater of the given values.

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

Since Kotlin

1.4

expect fun maxOf(a: Float, vararg other: Float): Float
expect fun maxOf(a: Double, vararg other: Double): Double

Returns the greater of the given values.

If any value is NaN, returns NaN.

Since Kotlin

1.4
actual fun <T : Comparable<T>> maxOf(a: T, b: T): T

Returns the greater of two values.

If values are equal, returns the first one.

Since Kotlin

1.1

actual inline fun maxOf(a: Byte, b: Byte): Byte
actual inline fun maxOf(a: Short, b: Short): Short
actual inline fun maxOf(a: Int, b: Int): Int
actual inline fun maxOf(a: Long, b: Long): Long

Returns the greater of two values.

Since Kotlin

1.1

actual inline fun maxOf(a: Float, b: Float): Float
actual inline fun maxOf(a: Double, b: Double): Double

Returns the greater of two values.

If either value is NaN, returns NaN.

Since Kotlin

1.1

actual fun <T : Comparable<T>> maxOf(a: T, b: T, c: T): T

Returns the greater of three values.

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

Since Kotlin

1.1

actual inline fun maxOf(a: Byte, b: Byte, c: Byte): Byte
actual inline fun maxOf(a: Short, b: Short, c: Short): Short
actual inline fun maxOf(a: Int, b: Int, c: Int): Int
actual inline fun maxOf(a: Long, b: Long, c: Long): Long

Returns the greater of three values.

Since Kotlin

1.1

actual inline fun maxOf(a: Float, b: Float, c: Float): Float
actual inline fun maxOf(a: Double, b: Double, c: Double): Double

Returns the greater of three values.

If any value is NaN, returns NaN.

Since Kotlin

1.1

actual fun <T : Comparable<T>> maxOf(a: T, vararg other: T): T

Returns the greater of the given values.

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

Since Kotlin

1.4

actual fun maxOf(a: Byte, vararg other: Byte): Byte
actual fun maxOf(a: Short, vararg other: Short): Short
actual fun maxOf(a: Int, vararg other: Int): Int
actual fun maxOf(a: Long, vararg other: Long): Long

Returns the greater of the given values.

Since Kotlin

1.4

actual fun maxOf(a: Float, vararg other: Float): Float
actual fun maxOf(a: Double, vararg other: Double): Double

Returns the greater of the given values.

If any value is NaN, returns NaN.

Since Kotlin

1.4
actual fun <T : Comparable<T>> maxOf(a: T, b: T): T

Returns the greater of two values.

If values are equal, returns the first one.

Since Kotlin

1.1

actual inline fun maxOf(a: Byte, b: Byte): Byte
actual inline fun maxOf(a: Short, b: Short): Short
actual inline fun maxOf(a: Int, b: Int): Int
actual inline fun maxOf(a: Long, b: Long): Long

Returns the greater of two values.

Since Kotlin

1.1

actual inline fun maxOf(a: Float, b: Float): Float
actual inline fun maxOf(a: Double, b: Double): Double

Returns the greater of two values.

If either value is NaN, returns NaN.

Since Kotlin

1.1

actual fun <T : Comparable<T>> maxOf(a: T, b: T, c: T): T

Returns the greater of three values.

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

Since Kotlin

1.1

actual inline fun maxOf(a: Byte, b: Byte, c: Byte): Byte
actual inline fun maxOf(a: Short, b: Short, c: Short): Short
actual inline fun maxOf(a: Int, b: Int, c: Int): Int
actual inline fun maxOf(a: Long, b: Long, c: Long): Long

Returns the greater of three values.

Since Kotlin

1.1

actual inline fun maxOf(a: Float, b: Float, c: Float): Float
actual inline fun maxOf(a: Double, b: Double, c: Double): Double

Returns the greater of three values.

If any value is NaN, returns NaN.

Since Kotlin

1.1

actual fun <T : Comparable<T>> maxOf(a: T, vararg other: T): T

Returns the greater of the given values.

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

Since Kotlin

1.4

actual fun maxOf(a: Byte, vararg other: Byte): Byte
actual fun maxOf(a: Short, vararg other: Short): Short
actual fun maxOf(a: Int, vararg other: Int): Int
actual fun maxOf(a: Long, vararg other: Long): Long

Returns the greater of the given values.

Since Kotlin

1.4

actual fun maxOf(a: Float, vararg other: Float): Float
actual fun maxOf(a: Double, vararg other: Double): Double

Returns the greater of the given values.

If any value is NaN, returns NaN.

Since Kotlin

1.4
actual fun <T : Comparable<T>> maxOf(a: T, b: T): T

Returns the greater of two values.

If values are equal, returns the first one.

Since Kotlin

1.1

actual inline fun maxOf(a: Byte, b: Byte): Byte
actual inline fun maxOf(a: Short, b: Short): Short
actual inline fun maxOf(a: Int, b: Int): Int
actual inline fun maxOf(a: Long, b: Long): Long

Returns the greater of two values.

Since Kotlin

1.1

actual inline fun maxOf(a: Float, b: Float): Float
actual inline fun maxOf(a: Double, b: Double): Double

Returns the greater of two values.

If either value is NaN, returns NaN.

Since Kotlin

1.1

actual fun <T : Comparable<T>> maxOf(a: T, b: T, c: T): T

Returns the greater of three values.

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

Since Kotlin

1.1

actual inline fun maxOf(a: Byte, b: Byte, c: Byte): Byte
actual inline fun maxOf(a: Short, b: Short, c: Short): Short
actual inline fun maxOf(a: Int, b: Int, c: Int): Int
actual inline fun maxOf(a: Long, b: Long, c: Long): Long

Returns the greater of three values.

Since Kotlin

1.1

actual inline fun maxOf(a: Float, b: Float, c: Float): Float
actual inline fun maxOf(a: Double, b: Double, c: Double): Double

Returns the greater of three values.

If any value is NaN, returns NaN.

Since Kotlin

1.1

actual fun <T : Comparable<T>> maxOf(a: T, vararg other: T): T

Returns the greater of the given values.

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

Since Kotlin

1.4

actual fun maxOf(a: Byte, vararg other: Byte): Byte
actual fun maxOf(a: Short, vararg other: Short): Short
actual fun maxOf(a: Int, vararg other: Int): Int
actual fun maxOf(a: Long, vararg other: Long): Long

Returns the greater of the given values.

Since Kotlin

1.4

actual fun maxOf(a: Float, vararg other: Float): Float
actual fun maxOf(a: Double, vararg other: Double): Double

Returns the greater of the given values.

If any value is NaN, returns NaN.

Since Kotlin

1.4