{
procedure and functions in this library
Sign returns sign (-1,0,+1) of integer value
Min returns minimum of two integers
Max returns maximum of two integers
ISwap trade two integer values
ISqrt returns integer square root of integer value
Condition forces integer into the range Min..Max
AMin returns minimum integer in array
AMax returns maximum integer in array
}
function Sign(Val : Integer) : Integer;
{
purpose returns sign (-1,0,1) of Val
last update 23 Jun 85
}
begin
if Val > 0
then Sign := 1
else if Val < 0
then Sign := -1
else Sign := 0
end; { of func Sign }
function Min(Val1,Val2 : Integer) : Integer;
{
purpose returns minimum of two integers
last update 08 Jul 85
}
begin
if Val1 < Val2
then Min := Val1
else Min := Val2
end; { of func Min }
function Max(Val1,Val2 : Integer) : Integer;
{
purpose returns maximum of two integers
last update 08 Jul 85
}
begin
if Val1 > Val2
then Max := Val1
else Max := Val2
end; { of func Max }
procedure ISwap(var Val1,Val2 : Integer);
{
purpose swaps values of Val1 and Val2
last update 08 Jul 85
}
var
Temp : Integer;
begin
Temp := Val1;
Val1 := Val2;
Val2 := Temp
end; { of proc ISwap }
function ISqrt(Val : Integer) : Integer;
{
purpose returns integer square root of Val
note well: this routine rounds to the nearest
square root
last update 23 Jan 85
}
var
OddSeq,Square,Ro
|