开发者

Class for calculating arbitrarily large numbers?

I was wondering if there might not be a class that would allow as much accuracy a开发者_开发百科s there is memory. With overloaded operators in order to do arithmetic on it as if it was a normal number.

Ex:

BigNumber num;

num = 8;
for(int i = 0; i < 5000000; ++i)
{
   num *= num;
}

Thanks


There are plenty libraries for that, like GMP (it provides also a C++ interface) or cbignum.

You'll probably find as many libraries of this kind as you wish.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜