Mojo module
random
Provides functions for random numbers.
You can import these APIs from the random
package. For example:
from random import seed
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!