maxOf
fun <T : Comparable<T>> maxOf(a: T, b: T): T
Returns the greater of two values.
If values are equal, returns the first one.
Returns the greater of two values.
Returns the greater of two values.
If either value is NaN
, returns NaN
.
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.
Returns the greater of three values.
Returns the greater of three values.
If any value is NaN
, returns NaN
.
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.
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.
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.
Returns the greater of the given values.
Returns the greater of the given values.
If any value is NaN
, returns NaN
.
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.
Returns the greater of two values.
Returns the greater of three values.
Returns the greater of the given values.