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
@@ -9722,6 +9722,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? {
@@ -9738,6 +9740,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? {
@@ -9819,6 +9823,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
@@ -9834,6 +9840,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
@@ -10141,6 +10149,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? {
@@ -10157,6 +10167,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? {
@@ -10238,6 +10250,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
@@ -10253,6 +10267,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
@@ -1464,6 +1464,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? {
@@ -1481,6 +1483,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? {
@@ -1545,6 +1549,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? {
@@ -1562,6 +1568,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? {
@@ -843,6 +843,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? {
@@ -860,6 +862,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? {
@@ -924,6 +928,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? {
@@ -941,6 +947,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? {