Skip to content

randomInt

Int randomInt(Int min, Int max)

Math · package dmla.Math · stdlib builtin

Returns a pseudorandom Int value in [min, max).

Parameters

  • Int min — Lower bound of the range (inclusive).
  • Int max — Upper bound (exclusive). Must be >= min.

Returns

Int — A pseudorandom value x such that min ≤ x < max.

Examples

Int r = randomInt(1, 6);

See Also