Skip to main content

module

random

Provides functions for random numbers.

You can import these APIs from the random package. For example:

from random import seed

Functions

  • seed: Seeds the random number generator using the current time.
  • random_float64: Returns a random Float64 number from the given range.
  • random_si64: Returns a random Int64 number from the given range.
  • random_ui64: Returns a random UInt64 number from the given range.
  • randint: Fills memory with uniform random in range [low, high].
  • rand: Fills memory with random values from a uniform distribution.
  • randn_float64: Returns a random double sampled from a Normal(mean, variance) distribution.
  • randn: Fills memory with random values from a Normal(mean, variance) distribution.