RandomNumberGenerator
Provides the core random classes and the primitive random number generators.
Nested types and modules
Type | Description |
GeneratorFunction<'a> | Generates random numbers. |
Prng<'s> | Represents a pseudorandom number generator that supports 64-bit resolution. |
PrngState | Represents a random state. |
RandomBuilder |
Functions and values
Function or value | Description |
( (0, 1) )
Signature: GeneratorFunction<float>
|
Returns a random number in the range of (0, 1). |
( (0, 1] )
Signature: GeneratorFunction<float>
|
Returns a random number in the range of (0, 1]. |
( [0, 1) )
Signature: GeneratorFunction<float>
|
Returns a random number in the range of [0, 1). |
( [0, 1] )
Signature: GeneratorFunction<float>
|
Returns a random number in the range of [0, 1]. |
createState prng seed
Signature: prng:Prng<'s> -> seed:'s -> PrngState
Type parameters: 's |
Constructs a random state. |
random
Signature: RandomBuilder
|
Constructs a random number function. |
rawBits
Signature: GeneratorFunction<uint64>
|
Returns a random 64-bit number. |
rint16
Signature: GeneratorFunction<int16>
|
Returns a random 16-bit signed integer. |
rint32
Signature: GeneratorFunction<int32>
|
Returns a random 32-bit signed integer. |
rint64
Signature: GeneratorFunction<int64>
|
Returns a random 64-bit signed integer. |
rint8
Signature: GeneratorFunction<int8>
|
Returns a random 8-bit signed integer. |
ruint16
Signature: GeneratorFunction<uint16>
|
Returns a random 16-bit unsigned integer. |
ruint32
Signature: GeneratorFunction<uint32>
|
Returns a random 32-bit unsigned integer. |
ruint64
Signature: GeneratorFunction<uint64>
|
Returns a random 64-bit unsigned integer. This function is an alias for . |
ruint8
Signature: GeneratorFunction<uint8>
|
Returns a random 8-bit unsigned integer. |
systemrandom
Signature: Prng<Random>
|
Random number generator using . |
xorshift
Signature: Prng<uint32 * uint32 * uint32 * uint32>
|
Random number generator using Xorshift algorithm (Marsaglia 2003). |