Sign in Join
FPDoc Onlineexperiment

Max function

In unit Math

Returns the largest of two values.

Declaration

pascal
function Max(a: Integer; b: Integer): Integer; overload

Description

Max returns the largest of the two values in the a and b arguments. The overloaded routines 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

Example: ex24

pascal
Program Example24;

{ Program to demonstrate the max function. }

Uses math;

Var
  A,B : Cardinal;

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

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.