Seeded random docs: add a note about repeatability not being preserved
We're not ready to give a guarantee that the seeded generator implementation will never change in future versions.
This commit is contained in:
@@ -268,7 +268,10 @@ public abstract class Random {
|
||||
/**
|
||||
* Returns a repeatable random number generator seeded with the given [seed] `Int` value.
|
||||
*
|
||||
* Two generators with the same seed produce the same sequence of values.
|
||||
* Two generators with the same seed produce the same sequence of values within the same version of Kotlin runtime.
|
||||
*
|
||||
* *Note:* Future versions of Kotlin may change the algorithm of this seeded number generator so that it will return
|
||||
* a sequence of values different from the current one for a given seed.
|
||||
*
|
||||
* @sample samples.random.Randoms.seededRandom
|
||||
*/
|
||||
@@ -278,7 +281,10 @@ public fun Random(seed: Int): Random = XorWowRandom(seed, seed.shr(31))
|
||||
/**
|
||||
* Returns a repeatable random number generator seeded with the given [seed] `Long` value.
|
||||
*
|
||||
* Two generators with the same seed produce the same sequence of values.
|
||||
* Two generators with the same seed produce the same sequence of values within the same version of Kotlin runtime.
|
||||
*
|
||||
* *Note:* Future versions of Kotlin may change the algorithm of this seeded number generator so that it will return
|
||||
* a sequence of values different from the current one for a given seed.
|
||||
*
|
||||
* @sample samples.random.Randoms.seededRandom
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user