hello ad1mt, silly tests often reveal bugs
the following silly test sets MV_i to factorial 10000, then in the following loop it divides MV_i by the sqrt(sqrt(sqrt(sqrt(sqrt(factorial 10000))))) 32 times, the result should be 1 but it's zero after the 17th divide
{$MODESWITCH NESTEDCOMMENTS+}
program speed_test;
uses sysutils
, strutils
, strings
, math
, Multi_Int
;
var
big_int_size,
start_time,
end_time :int32;
delta :double;
MV_i,
MV_k :Multi_Int_XV;
n:longint;
s:ansistring;
begin
big_int_size:= 1876;
Multi_Int_Initialisation(big_int_size);
s:='22800589663853877505317123043453362340893519704710196572342276129978';
s+='5396584763579883599204575708254300465107640442948149273572670233883';
s+='7284359538516468653306625429160207551503354344345787111445922584002';
s+='8181165619959806798093081539066769221754339703446744180324866502719';
s+='0583529084870239014806639408757137138171908408383470514328939737730';
s+='7786595490401129699001354712004975431883261644867724606315936597415';
s+='4172816638070902792312674816613501437397527507108784136297892120724';
s+='2258609187180759380286550432287007389509166022499552376394375731290';
s+='3695257424344652576833807767548298955014117685289979591337921315574';
s+='4143851718821477323546913115004666541473134847568172342426632844406';
s+='6932325217707899195155340149974932811967498981615287349348710134095';
s+='3136158397898370157895394723520831996509093434513075798856068558092';
s+='5418302202627073384336628756554287325388628135750737038028444664630';
s+='9660903249431243633032650772924592366776659937552528684543292162042';
s+='0537820044936663363199059424287956068270893800711294561314155959675';
s+='9088339153782291900491510646687410015510285225141061882566364889308';
s+='439408424494044324417996846046572131526273';
MV_k:=s; //sqrt(sqrt(sqrt(sqrt(sqrt(factorial 10000)))))
start_time:= GetTickCount64;
MV_i:=1;
for n:=2 to 10000 do
begin
MV_i:=MV_i*n;
end;
end_time:= GetTickCount64;
delta:= (end_time - start_time) / 1000;
writeln('time elapsed is ', delta:1:6, ' seconds');
start_time:= GetTickCount64;
for n:=1 to 16 do
begin
MV_i:=MV_i div MV_k;
end;
end_time:= GetTickCount64;
writeln;
write('should be 1 but it''s ');
writeln(MV_i.ToStr);
delta:= (end_time - start_time) / 1000;
writeln('time elapsed is ', delta:1:6, ' seconds');
end.