摘要
针对C++标准库不支持大整数类型的问题,设计并实现一个大整数类型,该类型提供了包括四则运算、运算符重载在内的一整套用于大整数运算的算法,并进一步封装成了类库提供对外调用接口,使得大数类的对象拥有和基本数据类型变量一样的行为.此外,该大数类对象还拥有自动管理内存的功能,从理论上讲,只要内存足够,可以对任意长度的整数进行运算.该大数类简单易用,在编程算法、极限运算等方面有一定的应用意义.
C ++ Standard Library is unavailable for big integer,and therefore, this paper designs and also achieves a big integer data type, which provides a suit of algorithms including arithmetic calculations and operation overload. Furthermore, the algorithms are encapsulated as a library which provides calling inter- faces for exterior,and makes the objects of the big integer function in the same way as the basic data type variables. In addition, obejcts based on big integer can also manage memory automatically. Theoretically, they can deal with any size of integer as long as the memory is large enough. The practice shows that this big integer library is simple and convenient, and has significant application meaning in programming, ex- treme computing, etc.
出处
《成都大学学报(自然科学版)》
2016年第3期252-255,270,共5页
Journal of Chengdu University(Natural Science Edition)
关键词
C++
大整数
类库
自动内存管理
C ++
big integer
library
automatic memory management