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

Max

Return largest of 2 values

Declaration

Source position: line 0

function Max(

  a: Integer;

  b: Integer

):Integer; overload;

function Max(

  a: Int64;

  b: Int64

):Int64; overload;

function Max(

  a: Extended;

  b: Extended

):Extended; overload;

Description

Max returns the maximum of Int1 and Int2.

Errors

None.

See also

min

  

Return smallest of two values.

maxIntValue

  

Return largest element in integer array

maxvalue

  

Return largest value in array

Example

Program Example24;

{ Program to demonstrate the max function. }

Uses math;

Var
  A,B : Cardinal;

begin
  A:=1;b:=2;
  writeln(max(a,b));
end.
The latest version of this document can be found at lazarus-ccr.sourceforge.net.