W3cubDocs

/Kotlin

maxOf

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

Platform and version requirements: Kotlin 1.1

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

inline fun maxOf(a: Byte, b: Byte): Byte

Platform and version requirements: Kotlin 1.1

inline fun maxOf(a: Short, b: Short): Short

Platform and version requirements: Kotlin 1.1

inline fun maxOf(a: Int, b: Int): Int

Platform and version requirements: Kotlin 1.1

inline fun maxOf(a: Long, b: Long): Long

Platform and version requirements: Kotlin 1.1

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

Platform and version requirements: Kotlin 1.1

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

Platform and version requirements: Kotlin 1.1

Returns the greater of two values.

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

Platform and version requirements: Kotlin 1.1

inline fun maxOf(a: Byte, b: Byte, c: Byte): Byte

Platform and version requirements: Kotlin 1.1

inline fun maxOf(a: Short, b: Short, c: Short): Short

Platform and version requirements: Kotlin 1.1

inline fun maxOf(a: Int, b: Int, c: Int): Int

Platform and version requirements: Kotlin 1.1

inline fun maxOf(a: Long, b: Long, c: Long): Long

Platform and version requirements: Kotlin 1.1

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

Platform and version requirements: Kotlin 1.1

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

Platform and version requirements: Kotlin 1.1

Returns the greater of three values.

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

Platform and version requirements: Kotlin 1.1, JVM

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

Platform and version requirements: Kotlin 1.1, JS

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

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

Platform and version requirements: Kotlin 1.1, JVM

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

Platform and version requirements: Kotlin 1.1, JS

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

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