文件名称:BigIntMultiplication
-
所属分类:
- 标签属性:
- 上传时间:2008-10-13
-
文件大小:1.5kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
大整数乘法例子代码
/* 递归边界,如果是1位二进制数与1位二进制数相乘,则可以直接计算 */
/*累计做1位二进制乘法运算的次数*/
/* return (X*Y) */
/* 计算n的值 */
/* 把X和Y拆分开来,令X=A*2^(n/2)+B, 左移位运算,mod = 1<<(n/2) */
/* 计算XY=AC*2^n+(AD+CB)*2^(n/2)+BD */
/* 计算A*C,再向左移n位 */
/* 递归计算A*D */
/* 递归计算C*B */
/* 计算a21+a22,再向左移n/2位 */
/* 递归计算B*D */
/* XY=a1+a2+a3 */
-large integer multiplication example code / * Recursive border, if it is a binary number with a binary number multiplication, can be directly calculated * / / * the beginning of a binary multiplication of the number * / / * return (X * Y) * / / * calculate the value of n * / / * X and Y to split it so that X = A * 2 ^ (n / 2) B, the left shift operator, mod = 1LT; lt; (n / 2) * / / * calculate XY = AC * 2 ^ n (AD CB) * 2 ^ (n / 2) BD * / / * A * C calculation, further n-bits * / / * recursive computation A * D * / / * recursive calculation of C * B * / / * Calculation A21 A22 and then bits n / 2 * / / * recursive calculation B * D * / / * XY = a1 a2 a3 * /
/* 递归边界,如果是1位二进制数与1位二进制数相乘,则可以直接计算 */
/*累计做1位二进制乘法运算的次数*/
/* return (X*Y) */
/* 计算n的值 */
/* 把X和Y拆分开来,令X=A*2^(n/2)+B, 左移位运算,mod = 1<<(n/2) */
/* 计算XY=AC*2^n+(AD+CB)*2^(n/2)+BD */
/* 计算A*C,再向左移n位 */
/* 递归计算A*D */
/* 递归计算C*B */
/* 计算a21+a22,再向左移n/2位 */
/* 递归计算B*D */
/* XY=a1+a2+a3 */
-large integer multiplication example code / * Recursive border, if it is a binary number with a binary number multiplication, can be directly calculated * / / * the beginning of a binary multiplication of the number * / / * return (X * Y) * / / * calculate the value of n * / / * X and Y to split it so that X = A * 2 ^ (n / 2) B, the left shift operator, mod = 1LT; lt; (n / 2) * / / * calculate XY = AC * 2 ^ n (AD CB) * 2 ^ (n / 2) BD * / / * A * C calculation, further n-bits * / / * recursive computation A * D * / / * recursive calculation of C * B * / / * Calculation A21 A22 and then bits n / 2 * / / * recursive calculation B * D * / / * XY = a1 a2 a3 * /
(系统自动生成,下载前可以参看下载内容)
下载文件列表
BigIntMultiplication.java
www.dssz.com.txt
www.dssz.com.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.