Skip to main content

Mojo function

random_ui64

random_ui64(min: UInt64, max: UInt64) -> UInt64

Returns a random UInt64 number from the given range [min, max].

Example:

from std.random import random_ui64, seed

seed()
var rnd = random_ui64(0, 100)
print(rnd)  # Random UInt64 between 0 and 100

Args:

  • min (UInt64): The minimum number in the range (inclusive).
  • max (UInt64): The maximum number in the range (inclusive).

Returns:

UInt64: A random unsigned integer sampled uniformly from [min, max].

Was this page helpful?