高精度除法
来源:互联网 发布:nba官方旗舰店 淘宝 编辑:程序博客网 时间:2024/05/16 11:14
5.高精度除以低精度procedure devide(a:hp;b:longint; var c:hp; var d:longint); {c:=a div b; d:= a mod b} var i,len:integer; begin fillchar(c,sizeof(c),0); len:=a[0]; d:=0; for i:=len downto 1 do begin d:=d*10+a[i]; c[i]:=d div b; d:=d mod b; end; while (len>1) and (c[len]=0) then dec(len); c[0]:=len; end;6.高精度除以高精度procedure high_devide(a,b:hp; var c,d:hp); var i,len:integer; begin fillchar(c,sizeof(c),0); fillchar(d,sizeof(d),0); len:=a[0];d[0]:=1; for i:=len downto 1 do begin multiply(d,10,d); d[1]:=a[i]; while(compare(d,b)>=0) do {即d>=b} begin Subtract(d,b,d); inc(c[i]); end; end; while(len>1)and(c.s[len]=0) do dec(len); c.len:=len; end;
0 0
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- 高精度除法
- hdu 2196 computer
- 自定义控件其实很简单3/4
- 《移动互联网下婚恋APP:应围绕“婚姻”做闭环》文章有感
- 菜单(一)
- pat 1087
- 高精度除法
- cocos2d-x lua中class的定义
- 详解map、multimap、unordered_map、unordered_multimap
- C++私有继承实现has-a关系
- hdu 1162 Eddy's picture 最小生成树入门题 Prim+Kruskal两种算法AC
- 【struts框架】第一节Action-NameSpace定义
- EEPROM组件
- 【struts框架】第一节Action-路径问题与创建Action方法
- 我理解的JAVA学习流程