|
@@ -42,9 +42,11 @@ interface
|
|
{# Returns the minimal value between @var(a) and @var(b) }
|
|
{# Returns the minimal value between @var(a) and @var(b) }
|
|
function min(a,b : longint) : longint;{$ifdef USEINLINE}inline;{$endif}
|
|
function min(a,b : longint) : longint;{$ifdef USEINLINE}inline;{$endif}
|
|
function min(a,b : int64) : int64;{$ifdef USEINLINE}inline;{$endif}
|
|
function min(a,b : int64) : int64;{$ifdef USEINLINE}inline;{$endif}
|
|
|
|
+ function min(a,b : qword) : qword;{$ifdef USEINLINE}inline;{$endif}
|
|
{# Returns the maximum value between @var(a) and @var(b) }
|
|
{# Returns the maximum value between @var(a) and @var(b) }
|
|
function max(a,b : longint) : longint;{$ifdef USEINLINE}inline;{$endif}
|
|
function max(a,b : longint) : longint;{$ifdef USEINLINE}inline;{$endif}
|
|
function max(a,b : int64) : int64;{$ifdef USEINLINE}inline;{$endif}
|
|
function max(a,b : int64) : int64;{$ifdef USEINLINE}inline;{$endif}
|
|
|
|
+ function max(a,b : qword) : qword;{$ifdef USEINLINE}inline;{$endif}
|
|
|
|
|
|
{ These functions are intenionally put here and not in the constexp unit.
|
|
{ These functions are intenionally put here and not in the constexp unit.
|
|
Since Tconstexprint may be automatically converted to int, which causes
|
|
Since Tconstexprint may be automatically converted to int, which causes
|
|
@@ -227,6 +229,18 @@ implementation
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
+ function min(a,b : qword) : qword;
|
|
|
|
+ {
|
|
|
|
+ return the minimal of a and b
|
|
|
|
+ }
|
|
|
|
+ begin
|
|
|
|
+ if a<=b then
|
|
|
|
+ min:=a
|
|
|
|
+ else
|
|
|
|
+ min:=b;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+
|
|
function max(a,b : longint) : longint;{$ifdef USEINLINE}inline;{$endif}
|
|
function max(a,b : longint) : longint;{$ifdef USEINLINE}inline;{$endif}
|
|
{
|
|
{
|
|
return the maximum of a and b
|
|
return the maximum of a and b
|
|
@@ -251,6 +265,18 @@ implementation
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
+ function max(a,b : qword) : qword;{$ifdef USEINLINE}inline;{$endif}
|
|
|
|
+ {
|
|
|
|
+ return the maximum of a and b
|
|
|
|
+ }
|
|
|
|
+ begin
|
|
|
|
+ if a>=b then
|
|
|
|
+ max:=a
|
|
|
|
+ else
|
|
|
|
+ max:=b;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+
|
|
function max(const a,b : Tconstexprint) : Tconstexprint;{$ifdef USEINLINE}inline;{$endif}
|
|
function max(const a,b : Tconstexprint) : Tconstexprint;{$ifdef USEINLINE}inline;{$endif}
|
|
{
|
|
{
|
|
return the maximum of a and b
|
|
return the maximum of a and b
|