[Overview][Constants][Types][Classes][Procedures and functions] Reference for unit 'math' (#rtl)

EnsureRange

Change value to it falls in specified range.

Declaration

Source position: line 0

function EnsureRange(

  const AValue: Integer;

  const AMin: Integer;

  const AMax: Integer

):Integer;

function EnsureRange(

  const AValue: Int64;

  const AMin: Int64;

  const AMax: Int64

):Int64;

Description

EnsureRangereturns Valueif AValueis in the range AMin..AMax. It returns AMinif the value is less than AMin, or AMaxif the value is larger than AMax.

See also

InRange

  

Check whether value is in range.