Mojo module
random
Provides functions for random numbers.
You can import these APIs from the random
package. For example:
from random import seed
Functionsβ
- β
rand
: Fills memory with random values from a uniform distribution. - β
randint
: Fills memory with uniform random in range [low, high]. - β
randn
: Fills memory with random values from a Normal(mean, variance) distribution. - β
randn_float64
: Returns a random double sampled from a Normal(mean, variance) distribution. - β
random_float64
: Returns a randomFloat64
number from the given range. - β
random_si64
: Returns a randomInt64
number from the given range. - β
random_ui64
: Returns a randomUInt64
number from the given range. - β
seed
: Seeds the random number generator using the current time.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
If you'd like to share more information, please report an issue on GitHub
π What went wrong?