Skip to content

RandomRange

Return a random number in a range

Declaration

Source position: math.pp line 513

  function RandomRange(const aFrom: Integer; const aTo: Integer) : Integer;
  function RandomRange(const aFrom: Int64; const aTo: Int64) : Int64;

Description

RandomRange returns a random value in the range AFrom to ATo. AFrom and ATo do not need to be in increasing order. The upper border is not included in the generated value, but the lower border is.

See also

Name Description
RandomFrom Return a random element of an array of numbers
#rtl.system.Random Generate random number