From d77f76bdb0aff76378a7dd53e55a2d3129ff63a0 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Sat, 30 Mar 2019 00:14:02 +0300 Subject: [PATCH] Clarify wording in Random.nextInt/Long/UInt/ULong docs #KT-30704 Fixed --- libraries/stdlib/src/kotlin/random/Random.kt | 6 +++--- libraries/stdlib/src/kotlin/random/URandom.kt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/stdlib/src/kotlin/random/Random.kt b/libraries/stdlib/src/kotlin/random/Random.kt index 41fa9dc7917..9387f4af405 100644 --- a/libraries/stdlib/src/kotlin/random/Random.kt +++ b/libraries/stdlib/src/kotlin/random/Random.kt @@ -36,7 +36,7 @@ public abstract class Random { public open fun nextInt(): Int = nextBits(32) /** - * Gets the next random non-negative `Int` from the random number generator not greater than the specified [until] bound. + * Gets the next random non-negative `Int` from the random number generator less than the specified [until] bound. * * Generates an `Int` random value uniformly distributed between `0` (inclusive) and the specified [until] bound (exclusive). * @@ -85,7 +85,7 @@ public abstract class Random { public open fun nextLong(): Long = nextInt().toLong().shl(32) + nextInt() /** - * Gets the next random non-negative `Long` from the random number generator not greater than the specified [until] bound. + * Gets the next random non-negative `Long` from the random number generator less than the specified [until] bound. * * Generates a `Long` random value uniformly distributed between `0` (inclusive) and the specified [until] bound (exclusive). * @@ -152,7 +152,7 @@ public abstract class Random { public open fun nextDouble(): Double = doubleFromParts(nextBits(26), nextBits(27)) /** - * Gets the next random non-negative `Double` from the random number generator not greater than the specified [until] bound. + * Gets the next random non-negative `Double` from the random number generator less than the specified [until] bound. * * Generates a `Double` random value uniformly distributed between 0 (inclusive) and [until] (exclusive). * diff --git a/libraries/stdlib/src/kotlin/random/URandom.kt b/libraries/stdlib/src/kotlin/random/URandom.kt index 46078bce8a4..35aec96eeeb 100644 --- a/libraries/stdlib/src/kotlin/random/URandom.kt +++ b/libraries/stdlib/src/kotlin/random/URandom.kt @@ -16,7 +16,7 @@ package kotlin.random public fun Random.nextUInt(): UInt = nextInt().toUInt() /** - * Gets the next random [UInt] from the random number generator not greater than the specified [until] bound. + * Gets the next random [UInt] from the random number generator not less the specified [until] bound. * * Generates a [UInt] random value uniformly distributed between `0` (inclusive) and the specified [until] bound (exclusive). * @@ -72,7 +72,7 @@ public fun Random.nextUInt(range: UIntRange): UInt = when { public fun Random.nextULong(): ULong = nextLong().toULong() /** - * Gets the next random [ULong] from the random number generator not greater than the specified [until] bound. + * Gets the next random [ULong] from the random number generator less than the specified [until] bound. * * Generates a [ULong] random value uniformly distributed between `0` (inclusive) and the specified [until] bound (exclusive). *