速度超快开方_压差与开方换算表
速度超快开方由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“压差与开方换算表”。
开方运算,高精度幂(程序中为Power),Longint指数(程序中为Exp),求底。估计底数范围后采用2分查找,速度很快。测试数据: 111 //指数
726599************563862*********0299450209***59204888124***7***9234******345***854503***02259675*********7143402335******00946481402544************806494707622***2******5114*********5148110451035******************2580******86993***57903237*********6***429******7579************076208020*********1420************4055566885382***9907939551************6291 //幂
//这个数据据说是以前一个人(叫什么Shakuntala Devi,谷歌一下)和电脑PK运算速度的测试数据,结果电脑输了,不爽,用这个程序重振电脑雄风,保证比那人快多了。type ltype=array [0..1000] of word;const enum:array [1..9] of longint=(16,128,1024,16384,131072,1048576,16777216,134217728,1073741824);var pwr,cpwr:ltype;exp,bse:longint;ta:ansistring;
function ttltype(a:ansistring):ltype;//Convert Ansistring to LType var i:longint;c:ltype;begin c[0]:=length(a);for i:=1 to c[0] do c[i]:=ord(a[c[0]-i+1])-48;ttltype:=c;end;
function ttltype(a:longint):ltype;//Convert Longint to LType var i:longint;c:ltype;begin c[0]:=0;i:=a;while i0 do begin c[c[0]+1]:=i mod 10;i:=i div 10;c[0]:=c[0]+1;end;ttltype:=c;end;
function multiply(a,b:ltype):ltype;//High_Multiply var c:ltype;t,i,j:longint;begin fillchar(c[0],sizeof(c),0);c[0]:=a[0]+b[0]+1;for i:=1 to a[0] do for j:=1 to b[0] do begin inc(c[i+j-1],a[i]*b[j] mod 10);c[i+j]:=c[i+j]+(a[i]*b[j] div 10)+(c[i+j-1] div 10);c[i+j-1]:=c[i+j-1] mod 10;end;while c[c[0]]=0 do dec(c[0]);multiply:=c;end;
function getpwr(bse:longint):ltype;//Calculate Power var c,nbse:ltype;i:longint;begin nbse:=ttltype(bse);c:=nbse;for i:=2 to exp do c:=multiply(nbse,c);getpwr:=c;end;
function chkbig:word;//Compare Power var i:longint;c:word;begin //cpwr > pwr-> 2 //cpwr 0 //cpwr = pwr-> 1 c:=1;//Normal State, If pwr=cpwr, It Never Changes if cpwr[0]>pwr[0] then //Compare Length
c:=2 else if cpwr[0]
pwr[i] then begin c:=2;break;end else if cpwr[i]
procedure op(a:longint);//Output begin writeln(a);close(input);close(output);halt;end;
procedure run(b,e:longint);//Main Procedure,Binary Search var a,i:longint;c:ltype;begin if b=e then op(b);a:=(b+e)div 2;cpwr:=getpwr(a);i:=chkbig;if i=2 then //Compare,Current(Temporary)Power > Real(Input From File)Power run(b,a)else if i=0 then //Compare,Current(Temporary)Power
procedure calc;var bl:longint;begin bl:=pwr[0] div exp+1;//Estimate Length of Result run(1,enum[bl]);//Bigger & Nearest Power of 2,Example:4 Digits->16384 end;
begin aign(input,'Num.txt');aign(output,'NumOut.txt');reset(input);rewrite(output);readln(exp);readln(ta);pwr:=ttltype(ta);calc;end.
历届快女超女前十 2004年快女 冠军:安又琪 亚军:王媞 季军:张含韵 第四名:Strings 第五名:孙一卜 第六名:陈文娅 第七名:杨旸第八名:张玥(退赛)(注:04年各分赛区冠军和亚军有进入总决赛......
速度话题作文:快与慢篇一:我们生活在这样一个时代——快餐、快递、快车已然成为时尚,只要稍稍放慢脚步,就跟不上时代滚滚而去的车轮。“欲速则不达”“慢工出细活”渐渐在现代人......
刀豆文库小编为你整合推荐9篇速度话题作文:快与慢,也许这些就是您需要的文章,但愿刀豆文库能带给您一些学习、工作上的帮助。......
复数·复数的开方·教案复数r(cosθ+isinθ)的n次方根.(二)探求复数r(cosθ+isinθ)的n次方根,并推导开方公式 师:(提出课题)求复数r(cosθ+isinθ)的n次方根.如何研究这一问题呢?首先,我们对复......
复数的开方教案1教学目标1.掌握求复数r(cosθ+isinθ)的n次方根的法则.2.通过复数开方公式的推导和运用,培养推理能力和运算能力.3.通过对复数r(cosθ+isinθ)的n次方根几何意义的探......
