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.0b1
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_si64

random_si64(min: Int64, max: Int64) -> Int64

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

Example:

from std.random import random_si64, seed

seed()
var rnd = random_si64(-100, 100)
print(rnd) # Random Int64 between -100 and 100

Args:

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

Returns:

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