文件名称:BigIntMultiplication
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 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 * /
(系统自动生成,下载前可以参看下载内容)
下载文件列表
压缩包 : 49636956bigintmultiplication.rar 列表 BigIntMultiplication.java