There's few in nxMath i could show up:

n is any floating point number. It gives a result that is always between 0 and 1, but most interesting thing happens when n is 0..1; it smoothens the pattern to match "top to low peak" of cosine wave.
[pascal]function Smoothen(n: single): single;
begin
if n<0 then n:=0
else if n>1 then n:=1;
Smoothen:=0.5-cos(n*pi)*0.5;
end;[/pascal]

Simply modulus, but this handles also negative numbers so that it remains continuous pattern at 0 point. 11 mod2 10 = 1 , -11 mod2 10 = -9
[pascal]function Mod2(a,b: integer): integer;
begin
if b=0 then result:=0
else begin
b:=abs(b);
result:=abs(a) mod b;
if (a<0) and (result>0) then result:=result-b;
end;
end;[/pascal]

And 1 more...
If you need to get power of 2 number that your current fits in, this is the function.
Giving n = 140 or 220 would result in 256.
[pascal]function Pow2fit(n: integer): integer;
var neg: boolean;
begin
if n<0 then begin
n:=-n; neg:=true;
end else neg:=false;
if n<3 then result:=n
else result:=round(intpower(2,ceil(log2(n))));
if neg then result:=-result;
end;[/pascal]
There's still Pow2near() which would give the nearest fit which would result in 128 in case of 140. These are all part of Next3D.