Introduce new overloads of max and min to fix NaN propagation behavior on JVM.
This commit is contained in:
@@ -5751,6 +5751,18 @@ public header inline fun BooleanArray.forEachIndexed(action: (Int, Boolean) -> U
|
||||
*/
|
||||
public header inline fun CharArray.forEachIndexed(action: (Int, Char) -> Unit): Unit
|
||||
|
||||
/**
|
||||
* Returns the largest element or `null` if there are no elements.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public header fun Array<out Double>.max(): Double?
|
||||
|
||||
/**
|
||||
* Returns the largest element or `null` if there are no elements.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public header fun Array<out Float>.max(): Float?
|
||||
|
||||
/**
|
||||
* Returns the largest element or `null` if there are no elements.
|
||||
*/
|
||||
@@ -5881,6 +5893,18 @@ public header fun BooleanArray.maxWith(comparator: Comparator<in Boolean>): Bool
|
||||
*/
|
||||
public header fun CharArray.maxWith(comparator: Comparator<in Char>): Char?
|
||||
|
||||
/**
|
||||
* Returns the smallest element or `null` if there are no elements.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public header fun Array<out Double>.min(): Double?
|
||||
|
||||
/**
|
||||
* Returns the smallest element or `null` if there are no elements.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public header fun Array<out Float>.min(): Float?
|
||||
|
||||
/**
|
||||
* Returns the smallest element or `null` if there are no elements.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user