EnsureRange
Change value so it fits in a specified range.
Declaration
Source position: math.pp line 202
function EnsureRange(const AValue: Integer; const AMin: Integer;
const AMax: Integer) : Integer; Overload;
function EnsureRange(const AValue: Int64; const AMin: Int64;
const AMax: Int64) : Int64; Overload;
function EnsureRange(const AValue: Double; const AMin: Double;
const AMax: Double) : Double; Overload;
Description
EnsureRange returns Value if AValue is in the range AMin..AMax. It returns AMin if the value is less than AMin, or AMax if the value is larger than AMax.
See also
Name | Description |
---|---|
InRange | Check whether value is in range. |