Skip to content

Min

Return smallest of two values.

Declaration

Source position: math.pp line 225

function Min(a: Integer; b: Integer) : Integer;  overload; overload;
function Min(a: Int64; b: Int64) : Int64;  overload; overload;
function Min(a: QWord; b: QWord) : QWord;  overload; overload;
function Min(a: Single; b: Single) : Single;  overload; overload;
function Min(a: Double; b: Double) : Double;  overload; overload;
function Min(a: Extended; b: Extended) : Extended;  overload; overload;

Description

Min returns the smallest of the two values in the a and b arguments. The overloaded variants use the same type for both of the compared arguments. The type for the first argument determines the overloaded function used for the comparison.

Errors

None.

See also

Name Description
max Returns the largest of two values.
minIntValue Return smallest value in integer array.
minValue Return smallest value in array.

Example

Program Example29;

{ Program to demonstrate the min function. }

Uses math;

Var
  A,B : Cardinal;

begin
  A:=1;b:=2;
  writeln(min(a,b));
end.