Hi, I just want to say i've been searching around this forum and have seen things about GMP and precision arithmetic (which im reading now).

However, i've seen nothing to the extreme of a number that I need. This is an *extremely* large number.
Before I even get into the specifics, ill write an example of how large it is.

2^x

where x is a power that is about 20,000 digits long. Is this even remotely possible for a regular computer? Thanks.

From my research, Mathematica uses GMP. When I try the equation, I receive an overflow well before what number I need.

Will writing a program natively work better?

Well 2^n requires n bits of storage space.

So n=20000 would be stored in about 2.5K of actual memory.

AFAIK, GMP is limited only by available memory, so this should be small beer to GMP.

> Mathematica uses GMP. When I try the equation, I receive an overflow well before what number I need.
Have you reported the bug?
Or read their mailing lists / forums etc?

Thanks for answer, but n is not 20,000. It is at least 20,000 DIGITS long.
I'm pretty much convinced at this point that this is a problem for a supercomputer. Thanks for the help though.

we will assume the library is using 1 byte for each digit in the number you would need. then as 2 is multiplied by 2 each time it doubles and you get about 3 times before it adds another place to the number. so at best you would be looking at a piece of memory of (10^19991 / 3) GB. if there using different bases or what not it will go down but not by to much. I'm not sue if supercomputers can compute that or not but your desktop will never get there as the limits of memory are right now. may i ask why you need a 20,000 digit exponent?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.