Biggest Bignum

jpmay's picture

On his blog, Jaime Zawinski (of Netscape and XEmacs fame) relates a tale of finding limits in the (supposedly) unlimited big number representation on a TI Lisp machine in the early 1990s. It is an amusing story, and it makes me wonder if GnuMP is has a similar limit on a different scale.  Or in other words, is there a positive integer small enough to fit into memory  (assuming 64 bit address space) but that cannot actually be constructed in GnuMP due to limits in the implementation? Does someone here know enough about the GnuMP internals to give the answer?

Comments

bigger

Netscape fame?  You meant, of course, the more significant and longer lasting (X)emacs fame 8-).

jpmay's picture

Of course you're right. :D 

Of course you're right. :D  Post now corrected.

roman_pearce's picture

largest integer

On a 32-bit machine you can exhaust the 4GB address space. That's 32 billion bits, or log[10](2^32) decimal digits. In practice most operating systems will only let you use 2GB of RAM, so 10^9 digits is more realistic. Just don't expect to do anything with that number.

For 64-bit machines, GMP still uses 32-bit (signed) integers for the number of words allocated, but words are now 64-bits. The largest integer you can represent is 16GB (2^31 words) and that gives you 10^11 decimal digits.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}