Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,39 @@
|
|||
function VanDerCorput(N,Base: integer): double;
|
||||
{Calculate binary value for numbers right of decimal}
|
||||
var Value,Exponent,Digit: integer;
|
||||
begin
|
||||
Value:= N; Result:= 0; Exponent:= -1;
|
||||
{D1 * Base^-1 + D2 * Base^-2 + D3 * Base^-3}
|
||||
while Value > 0 do
|
||||
begin
|
||||
{Get digit in specified base}
|
||||
Digit:=Value mod Base;
|
||||
{Digit * Base^-Exponent}
|
||||
Result:=Result + Digit * Power(Base,Exponent);
|
||||
{Divide by base to put next digit in place}
|
||||
Value:= Value div Base;
|
||||
{Next exponent}
|
||||
Dec(Exponent);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure ShowVanDerCorput(Memo: TMemo);
|
||||
{Show Vander Coput numbers for bases 2..8 and items 1..9 }
|
||||
var Base,N: integer;
|
||||
var V: double;
|
||||
var S: string;
|
||||
begin
|
||||
S:='';
|
||||
for Base:=2 to 8 do
|
||||
begin
|
||||
S:=S+Format('Base %D:',[Base]);
|
||||
for N:=1 to 10 do
|
||||
begin
|
||||
V:=VanDerCorput(N,Base);
|
||||
S:=S+Format(' %1.5f',[V]);
|
||||
end;
|
||||
S:=S+CRLF;
|
||||
end;
|
||||
Memo.Lines.Add(S);
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue