如何用vb实现两个128位数的加减法计算器?
好像是用数组实现吧.....不太会~有没有高人解答一下~多谢
高精度加法 function hiPlus(s1,s2:string):string; var a,b:array[1..100] of byte; k,l1,l2,i,j:integer;tmpstr:string; begin l1:=length(s1);l2:=length(s2); fillchar(a,sizeof(a),0); fillchar(b,sizeof(b),0); if l1>l2 then j:=l1 else j:=l2; k:=0; for i:=l1 downto 1 do begin inc(k); a[k]:=ord(s1[i])-48; end; k:=0; for i:=l2 downto 1 do begin inc(k); b[k]:=ord(s2[i])-48; end; for i:=1 to j do begin [ a[i]:=a[i]+b[i]; if a[i]>=10 then begin a[i]:=a[i]-10; a[i+1]:=a[i+1]+1; end; ] end; if a[j+1]=0 then j:=j-1; tmpstr:=''; for i:=j+1 downto 1 do tmpstr:=tmpstr+chr(a[i]+48); hiPlus:=tmpstr end; 高精度减法 if a[i]<b[i] then begin a[i+1]:=a[i+1]-1; a[i]:=a[i]+10; end; a[i]:=a[i]-b[i];