Sync minOf/maxOf NaN-propagation documentation

This commit is contained in:
Abduqodiri Qurbonzoda
2020-06-08 05:46:14 +03:00
committed by Abduqodiri Qurbonzoda
parent 888da2e0b1
commit 1ba353291b
@@ -13,6 +13,7 @@ package kotlin.comparisons
/** /**
* Returns the greater of two values. * Returns the greater of two values.
*
* If values are equal, returns the first one. * If values are equal, returns the first one.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@@ -58,6 +59,8 @@ public actual inline fun maxOf(a: Long, b: Long): Long {
/** /**
* Returns the greater of two values. * Returns the greater of two values.
*
* If either value is `NaN`, returns `NaN`.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@@ -67,6 +70,8 @@ public actual inline fun maxOf(a: Float, b: Float): Float {
/** /**
* Returns the greater of two values. * Returns the greater of two values.
*
* If either value is `NaN`, returns `NaN`.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@@ -76,6 +81,8 @@ public actual inline fun maxOf(a: Double, b: Double): Double {
/** /**
* Returns the greater of three values. * Returns the greater of three values.
*
* If there are multiple equal maximal values, returns the first of them.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
public actual fun <T : Comparable<T>> maxOf(a: T, b: T, c: T): T { public actual fun <T : Comparable<T>> maxOf(a: T, b: T, c: T): T {
@@ -120,6 +127,8 @@ public actual inline fun maxOf(a: Long, b: Long, c: Long): Long {
/** /**
* Returns the greater of three values. * Returns the greater of three values.
*
* If any value is `NaN`, returns `NaN`.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@@ -129,6 +138,8 @@ public actual inline fun maxOf(a: Float, b: Float, c: Float): Float {
/** /**
* Returns the greater of three values. * Returns the greater of three values.
*
* If any value is `NaN`, returns `NaN`.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@@ -137,7 +148,9 @@ public actual inline fun maxOf(a: Double, b: Double, c: Double): Double {
} }
/** /**
* Returns the greater of given values. * Returns the greater of the given values.
*
* If there are multiple equal maximal values, returns the first of them.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
public actual fun <T : Comparable<T>> maxOf(a: T, vararg other: T): T { public actual fun <T : Comparable<T>> maxOf(a: T, vararg other: T): T {
@@ -147,7 +160,7 @@ public actual fun <T : Comparable<T>> maxOf(a: T, vararg other: T): T {
} }
/** /**
* Returns the greater of given values. * Returns the greater of the given values.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
public actual fun maxOf(a: Byte, vararg other: Byte): Byte { public actual fun maxOf(a: Byte, vararg other: Byte): Byte {
@@ -157,7 +170,7 @@ public actual fun maxOf(a: Byte, vararg other: Byte): Byte {
} }
/** /**
* Returns the greater of given values. * Returns the greater of the given values.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
public actual fun maxOf(a: Short, vararg other: Short): Short { public actual fun maxOf(a: Short, vararg other: Short): Short {
@@ -167,7 +180,7 @@ public actual fun maxOf(a: Short, vararg other: Short): Short {
} }
/** /**
* Returns the greater of given values. * Returns the greater of the given values.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
public actual fun maxOf(a: Int, vararg other: Int): Int { public actual fun maxOf(a: Int, vararg other: Int): Int {
@@ -177,7 +190,7 @@ public actual fun maxOf(a: Int, vararg other: Int): Int {
} }
/** /**
* Returns the greater of given values. * Returns the greater of the given values.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
public actual fun maxOf(a: Long, vararg other: Long): Long { public actual fun maxOf(a: Long, vararg other: Long): Long {
@@ -187,7 +200,9 @@ public actual fun maxOf(a: Long, vararg other: Long): Long {
} }
/** /**
* Returns the greater of given values. * Returns the greater of the given values.
*
* If any value is `NaN`, returns `NaN`.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
public actual fun maxOf(a: Float, vararg other: Float): Float { public actual fun maxOf(a: Float, vararg other: Float): Float {
@@ -197,7 +212,9 @@ public actual fun maxOf(a: Float, vararg other: Float): Float {
} }
/** /**
* Returns the greater of given values. * Returns the greater of the given values.
*
* If any value is `NaN`, returns `NaN`.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
public actual fun maxOf(a: Double, vararg other: Double): Double { public actual fun maxOf(a: Double, vararg other: Double): Double {
@@ -208,6 +225,7 @@ public actual fun maxOf(a: Double, vararg other: Double): Double {
/** /**
* Returns the smaller of two values. * Returns the smaller of two values.
*
* If values are equal, returns the first one. * If values are equal, returns the first one.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@@ -253,6 +271,8 @@ public actual inline fun minOf(a: Long, b: Long): Long {
/** /**
* Returns the smaller of two values. * Returns the smaller of two values.
*
* If either value is `NaN`, returns `NaN`.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@@ -266,6 +286,8 @@ public actual inline fun minOf(a: Float, b: Float): Float {
/** /**
* Returns the smaller of two values. * Returns the smaller of two values.
*
* If either value is `NaN`, returns `NaN`.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@@ -279,6 +301,8 @@ public actual inline fun minOf(a: Double, b: Double): Double {
/** /**
* Returns the smaller of three values. * Returns the smaller of three values.
*
* If there are multiple equal minimal values, returns the first of them.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
public actual fun <T : Comparable<T>> minOf(a: T, b: T, c: T): T { public actual fun <T : Comparable<T>> minOf(a: T, b: T, c: T): T {
@@ -323,6 +347,8 @@ public actual inline fun minOf(a: Long, b: Long, c: Long): Long {
/** /**
* Returns the smaller of three values. * Returns the smaller of three values.
*
* If any value is `NaN`, returns `NaN`.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@@ -332,6 +358,8 @@ public actual inline fun minOf(a: Float, b: Float, c: Float): Float {
/** /**
* Returns the smaller of three values. * Returns the smaller of three values.
*
* If any value is `NaN`, returns `NaN`.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@@ -340,7 +368,9 @@ public actual inline fun minOf(a: Double, b: Double, c: Double): Double {
} }
/** /**
* Returns the smaller of given values. * Returns the smaller of the given values.
*
* If there are multiple equal minimal values, returns the first of them.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
public actual fun <T : Comparable<T>> minOf(a: T, vararg other: T): T { public actual fun <T : Comparable<T>> minOf(a: T, vararg other: T): T {
@@ -350,7 +380,7 @@ public actual fun <T : Comparable<T>> minOf(a: T, vararg other: T): T {
} }
/** /**
* Returns the smaller of given values. * Returns the smaller of the given values.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
public actual fun minOf(a: Byte, vararg other: Byte): Byte { public actual fun minOf(a: Byte, vararg other: Byte): Byte {
@@ -360,7 +390,7 @@ public actual fun minOf(a: Byte, vararg other: Byte): Byte {
} }
/** /**
* Returns the smaller of given values. * Returns the smaller of the given values.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
public actual fun minOf(a: Short, vararg other: Short): Short { public actual fun minOf(a: Short, vararg other: Short): Short {
@@ -370,7 +400,7 @@ public actual fun minOf(a: Short, vararg other: Short): Short {
} }
/** /**
* Returns the smaller of given values. * Returns the smaller of the given values.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
public actual fun minOf(a: Int, vararg other: Int): Int { public actual fun minOf(a: Int, vararg other: Int): Int {
@@ -380,7 +410,7 @@ public actual fun minOf(a: Int, vararg other: Int): Int {
} }
/** /**
* Returns the smaller of given values. * Returns the smaller of the given values.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
public actual fun minOf(a: Long, vararg other: Long): Long { public actual fun minOf(a: Long, vararg other: Long): Long {
@@ -390,7 +420,9 @@ public actual fun minOf(a: Long, vararg other: Long): Long {
} }
/** /**
* Returns the smaller of given values. * Returns the smaller of the given values.
*
* If any value is `NaN`, returns `NaN`.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
public actual fun minOf(a: Float, vararg other: Float): Float { public actual fun minOf(a: Float, vararg other: Float): Float {
@@ -400,7 +432,9 @@ public actual fun minOf(a: Float, vararg other: Float): Float {
} }
/** /**
* Returns the smaller of given values. * Returns the smaller of the given values.
*
* If any value is `NaN`, returns `NaN`.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
public actual fun minOf(a: Double, vararg other: Double): Double { public actual fun minOf(a: Double, vararg other: Double): Double {