Introduce new overloads of max and min to fix NaN propagation behavior on JVM.
This commit is contained in:
@@ -765,6 +765,18 @@ public header inline fun <T> Iterable<T>.forEach(action: (T) -> Unit): Unit
|
||||
*/
|
||||
public header inline fun <T> Iterable<T>.forEachIndexed(action: (Int, T) -> Unit): Unit
|
||||
|
||||
/**
|
||||
* Returns the largest element or `null` if there are no elements.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public header fun Iterable<Double>.max(): Double?
|
||||
|
||||
/**
|
||||
* Returns the largest element or `null` if there are no elements.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public header fun Iterable<Float>.max(): Float?
|
||||
|
||||
/**
|
||||
* Returns the largest element or `null` if there are no elements.
|
||||
*/
|
||||
@@ -780,6 +792,18 @@ public header inline fun <T, R : Comparable<R>> Iterable<T>.maxBy(selector: (T)
|
||||
*/
|
||||
public header fun <T> Iterable<T>.maxWith(comparator: Comparator<in T>): T?
|
||||
|
||||
/**
|
||||
* Returns the smallest element or `null` if there are no elements.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public header fun Iterable<Double>.min(): Double?
|
||||
|
||||
/**
|
||||
* Returns the smallest element or `null` if there are no elements.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public header fun Iterable<Float>.min(): Float?
|
||||
|
||||
/**
|
||||
* Returns the smallest element or `null` if there are no elements.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user