摘要
本文以C++语言设计了大整数类,在类中以数组存储大整数,同时借鉴分治算法思想实现了大整数的乘法运算。算法中将被乘数与乘数按照相同位数进行分组,通过对每组较小数值整数进行乘法和加法运算而得到大整数相乘的积。该程序在VC++2015开发平台调试通过。测试结果表明,当每个分组数据位数多时,运算速度显著提高。
To implement multiplication of large integers,this paper introduces large integers class with the C ++ programming language and utilizes array to store large integers. Based on divide and conquer algorithm,the proposed method divides multiplicand and multiplier into groups with same size. Based on divide and conquer algorithm,it gets the product of the large integers multiplication by transferring the direct multiplication into modular operation on individual groups with smaller numerical value. The program is implemented successfully on VC ++ 2015.The test results show that the operation speed for integers in large number increases a lot.
出处
《微型机与应用》
2017年第2期8-9,13,共3页
Microcomputer & Its Applications
关键词
大整数
大整数相乘
分治算法
类
large integers
large integers multiplication
divide and conquer algorithm
class