Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Arbitrary-precision arithmetic unlimited size?

Options
  • 02-12-2009 1:55am
    #1
    Registered Users Posts: 1,190 ✭✭✭


    Are there any libraries that can hold an infinitely large number (excluding the fact that physical and virtual memory is limited of course) . I was looking through some documentation of this and it occurred to me that you could just link multiple arrays together. So for example let's say an array could only fit 3 digits. You could have an array that linked the first third of the number was contained in array 1 the second in array 2 and so on. And then when you run out of array sizes you just keep repeating this on a higher level so the original top level array becomes the first part in a bigger number.


Comments

  • Registered Users Posts: 1,422 ✭✭✭Merrion


    I can't see how that would improve over storing the super very large numbers in a non fixed size memory chunk. (Similar to the way BSTR are stored - the first word of the variable tells you how many words the variable holds)

    However the real trick with super very large numbers is not the memory but performing mathmatical functions sufficiently efficiently to be used.


  • Closed Accounts Posts: 1,397 ✭✭✭Herbal Deity


    wolfric wrote: »
    Are there any libraries that can hold an infinitely large number (excluding the fact that physical and virtual memory is limited of course) .
    of course


Advertisement