How to handle arbitrarily large integers

2019-01-09 01:47发布

I'm working on a programming language, and today I got the point where I could compile the factorial function(recursive), however due to the maximum size of an integer the largest I can get is factorial(12). What are some techniques for handling integers of an arbitrary maximum size. The language currently works by translating code to C++.

7条回答
时光不老,我们不散
2楼-- · 2019-01-09 02:13

If you want to roll your own arbitrary precision library, see Knuth's Seminumerical Algorithms, volume 2 of his magnum opus.

查看更多
登录 后发表回答