Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Maximum digits in GMP?


    Hi,


    Just like I said in the title, how much big number can be managed by gmp library under plain GCC environment? (does GMP cover infinite length of integer?)

  2. #2
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    Hi,

    RTFM

    There is no "infinite number" in computing. You always reach somewhere borders, either by computational complexity or memory. How would you store such a big number in memory? In fact these are also the limitations of GMP.

    Using GMP 5.0, a fast 64-bit computer, and sufficient memory, it should be possible to compute up to 41 billion digits. Unfortunately, the memory requirements are about 8n bytes for computing n digits, which will make most desktop computers unfit for 41 billion digit computations. Memory locality in the FFT multiply code of GMP 5.0's is not good enough for efficient computation with operands on disk.

    Attempting computations of more than 41 billion digits will cause overflow in the mpz type. A planned future version of GMP will allow the patient and wealthy to compute up to at least 1 quadrillion (1015) digits, and unlike current GMP, this future GMP will operate fine with operands on disk. You'll need around 4000 high-end swap disks in order to compute 1 quintillion digits, but surely that will qualify you for a discount ("buy 4000, pay for 3999").

  3. #3
    Quote Originally Posted by Kloschüssel View Post
    Hi,
    There is no "infinite number" in computing. You always reach somewhere borders, either by computational complexity or memory. How would you store such a big number in memory?
    Hey, dead old thread revival here, no apologies, but...

    You would store such a big number on the Hard Drive, and compress it. When you run out of space on the hard drive, prompt the user to add another USB hard drive. Use your hard drive as your memory storage. If the hard drive is only 1 Terrabyte, don't worry, we've got you covered: compress the 1 Terrabyte drive so that more space is available on it, and use not some phony cruddy Gzip/Tar/Zip/7Zip compression, but a mathematical theory of compression that compresses numbers to near infinity.

    Turings worst nightmare is that the ticker tape keeps on going, because someone compressed the tickertape and Turing wasn't looking when it was compressed...

    Oh and, you can also work on the number in sections or parts - not the whole number needs to be worked on at all times, so you can take a chunk of it in, then work with the next chunk... Compress most of the number but work with a small part of it uncompressed

    There are ways, there are ways...

    Bye now!

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •