Skip to main content

Mojo function

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

Was this page helpful?