IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.0.0b2
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

random_ui64

def 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].