From b74fe7c1c332d0475b8c4002f78c522e6c071855 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Fri, 15 Mar 2019 19:23:07 +0300 Subject: [PATCH] Clarify floor and ceil docs (KT-30418) --- libraries/stdlib/common/src/kotlin/MathH.kt | 8 ++++---- libraries/stdlib/js/src/kotlin/math.kt | 8 ++++---- libraries/stdlib/jvm/src/kotlin/util/MathJVM.kt | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libraries/stdlib/common/src/kotlin/MathH.kt b/libraries/stdlib/common/src/kotlin/MathH.kt index 5aa9682c6d3..ec7160590e8 100644 --- a/libraries/stdlib/common/src/kotlin/MathH.kt +++ b/libraries/stdlib/common/src/kotlin/MathH.kt @@ -275,7 +275,7 @@ public expect fun ln1p(x: Double): Double /** * Rounds the given value [x] to an integer towards positive infinity. - * @return the smallest double value that is greater than the given value [x] and is a mathematical integer. + * @return the smallest double value that is greater than or equal to the given value [x] and is a mathematical integer. * * Special cases: * - `ceil(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer. @@ -286,7 +286,7 @@ public expect fun ceil(x: Double): Double /** * Rounds the given value [x] to an integer towards negative infinity. - * @return the largest double value that is smaller than the given value [x] and is a mathematical integer. + * @return the largest double value that is smaller than or equal to the given value [x] and is a mathematical integer. * * Special cases: * - `floor(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer. @@ -736,7 +736,7 @@ public expect fun ln1p(x: Float): Float /** * Rounds the given value [x] to an integer towards positive infinity. - * @return the smallest Float value that is greater than the given value [x] and is a mathematical integer. + * @return the smallest Float value that is greater than or equal to the given value [x] and is a mathematical integer. * * Special cases: * - `ceil(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer. @@ -747,7 +747,7 @@ public expect fun ceil(x: Float): Float /** * Rounds the given value [x] to an integer towards negative infinity. - * @return the largest Float value that is smaller than the given value [x] and is a mathematical integer. + * @return the largest Float value that is smaller than or equal to the given value [x] and is a mathematical integer. * * Special cases: * - `floor(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer. diff --git a/libraries/stdlib/js/src/kotlin/math.kt b/libraries/stdlib/js/src/kotlin/math.kt index bf9aa1b3c8e..f519153d131 100644 --- a/libraries/stdlib/js/src/kotlin/math.kt +++ b/libraries/stdlib/js/src/kotlin/math.kt @@ -289,7 +289,7 @@ public actual inline fun ln1p(x: Double): Double = nativeMath.log1p(x) /** * Rounds the given value [x] to an integer towards positive infinity. - * @return the smallest double value that is greater than the given value [x] and is a mathematical integer. + * @return the smallest double value that is greater than or equal to the given value [x] and is a mathematical integer. * * Special cases: * - `ceil(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer. @@ -301,7 +301,7 @@ public actual inline fun ceil(x: Double): Double = nativeMath.ceil(x).unsafeCast /** * Rounds the given value [x] to an integer towards negative infinity. - * @return the largest double value that is smaller than the given value [x] and is a mathematical integer. + * @return the largest double value that is smaller than or equal to the given value [x] and is a mathematical integer. * * Special cases: * - `floor(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer. @@ -824,7 +824,7 @@ public actual inline fun ln1p(x: Float): Float = nativeMath.log1p(x.toDouble()). /** * Rounds the given value [x] to an integer towards positive infinity. - * @return the smallest Float value that is greater than the given value [x] and is a mathematical integer. + * @return the smallest Float value that is greater than or equal to the given value [x] and is a mathematical integer. * * Special cases: * - `ceil(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer. @@ -836,7 +836,7 @@ public actual inline fun ceil(x: Float): Float = nativeMath.ceil(x.toDouble()).t /** * Rounds the given value [x] to an integer towards negative infinity. - * @return the largest Float value that is smaller than the given value [x] and is a mathematical integer. + * @return the largest Float value that is smaller than or equal to the given value [x] and is a mathematical integer. * * Special cases: * - `floor(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer. diff --git a/libraries/stdlib/jvm/src/kotlin/util/MathJVM.kt b/libraries/stdlib/jvm/src/kotlin/util/MathJVM.kt index d207cca5c9b..01bab9d9860 100644 --- a/libraries/stdlib/jvm/src/kotlin/util/MathJVM.kt +++ b/libraries/stdlib/jvm/src/kotlin/util/MathJVM.kt @@ -371,7 +371,7 @@ public actual inline fun ln1p(x: Double): Double = nativeMath.log1p(x) /** * Rounds the given value [x] to an integer towards positive infinity. - * @return the smallest double value that is greater than the given value [x] and is a mathematical integer. + * @return the smallest double value that is greater than or equal to the given value [x] and is a mathematical integer. * * Special cases: * - `ceil(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer. @@ -383,7 +383,7 @@ public actual inline fun ceil(x: Double): Double = nativeMath.ceil(x) /** * Rounds the given value [x] to an integer towards negative infinity. - * @return the largest double value that is smaller than the given value [x] and is a mathematical integer. + * @return the largest double value that is smaller than or equal to the given value [x] and is a mathematical integer. * * Special cases: * - `floor(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer. @@ -901,7 +901,7 @@ public actual inline fun ln1p(x: Float): Float = nativeMath.log1p(x.toDouble()). /** * Rounds the given value [x] to an integer towards positive infinity. - * @return the smallest Float value that is greater than the given value [x] and is a mathematical integer. + * @return the smallest Float value that is greater than or equal to the given value [x] and is a mathematical integer. * * Special cases: * - `ceil(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer. @@ -913,7 +913,7 @@ public actual inline fun ceil(x: Float): Float = nativeMath.ceil(x.toDouble()).t /** * Rounds the given value [x] to an integer towards negative infinity. - * @return the largest Float value that is smaller than the given value [x] and is a mathematical integer. + * @return the largest Float value that is smaller than or equal to the given value [x] and is a mathematical integer. * * Special cases: * - `floor(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.