Add a note about NaN propagation for floating point specializations.

This commit is contained in:
Ilya Gorbunov
2017-01-09 23:53:21 +03:00
parent 897e9658ac
commit 3bf38e62c8
11 changed files with 104 additions and 1 deletions
+16
View File
@@ -9805,6 +9805,8 @@ public inline fun CharArray.forEachIndexed(action: (Int, Char) -> Unit): Unit {
/**
* Returns the largest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
@SinceKotlin("1.1")
public fun Array<out Double>.max(): Double? {
@@ -9821,6 +9823,8 @@ public fun Array<out Double>.max(): Double? {
/**
* Returns the largest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
@SinceKotlin("1.1")
public fun Array<out Float>.max(): Float? {
@@ -9902,6 +9906,8 @@ public fun LongArray.max(): Long? {
/**
* Returns the largest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
public fun FloatArray.max(): Float? {
if (isEmpty()) return null
@@ -9917,6 +9923,8 @@ public fun FloatArray.max(): Float? {
/**
* Returns the largest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
public fun DoubleArray.max(): Double? {
if (isEmpty()) return null
@@ -10224,6 +10232,8 @@ public fun CharArray.maxWith(comparator: Comparator<in Char>): Char? {
/**
* Returns the smallest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
@SinceKotlin("1.1")
public fun Array<out Double>.min(): Double? {
@@ -10240,6 +10250,8 @@ public fun Array<out Double>.min(): Double? {
/**
* Returns the smallest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
@SinceKotlin("1.1")
public fun Array<out Float>.min(): Float? {
@@ -10321,6 +10333,8 @@ public fun LongArray.min(): Long? {
/**
* Returns the smallest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
public fun FloatArray.min(): Float? {
if (isEmpty()) return null
@@ -10336,6 +10350,8 @@ public fun FloatArray.min(): Float? {
/**
* Returns the smallest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
public fun DoubleArray.min(): Double? {
if (isEmpty()) return null
@@ -1475,6 +1475,8 @@ public inline fun <T> Iterable<T>.forEachIndexed(action: (Int, T) -> Unit): Unit
/**
* Returns the largest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
@SinceKotlin("1.1")
public fun Iterable<Double>.max(): Double? {
@@ -1492,6 +1494,8 @@ public fun Iterable<Double>.max(): Double? {
/**
* Returns the largest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
@SinceKotlin("1.1")
public fun Iterable<Float>.max(): Float? {
@@ -1556,6 +1560,8 @@ public fun <T> Iterable<T>.maxWith(comparator: Comparator<in T>): T? {
/**
* Returns the smallest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
@SinceKotlin("1.1")
public fun Iterable<Double>.min(): Double? {
@@ -1573,6 +1579,8 @@ public fun Iterable<Double>.min(): Double? {
/**
* Returns the smallest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
@SinceKotlin("1.1")
public fun Iterable<Float>.min(): Float? {
@@ -862,6 +862,8 @@ public inline fun <T> Sequence<T>.forEachIndexed(action: (Int, T) -> Unit): Unit
/**
* Returns the largest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
@SinceKotlin("1.1")
public fun Sequence<Double>.max(): Double? {
@@ -879,6 +881,8 @@ public fun Sequence<Double>.max(): Double? {
/**
* Returns the largest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
@SinceKotlin("1.1")
public fun Sequence<Float>.max(): Float? {
@@ -943,6 +947,8 @@ public fun <T> Sequence<T>.maxWith(comparator: Comparator<in T>): T? {
/**
* Returns the smallest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
@SinceKotlin("1.1")
public fun Sequence<Double>.min(): Double? {
@@ -960,6 +966,8 @@ public fun Sequence<Double>.min(): Double? {
/**
* Returns the smallest element or `null` if there are no elements.
*
* If any of elements is `NaN` returns `NaN`.
*/
@SinceKotlin("1.1")
public fun Sequence<Float>.min(): Float? {