Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Arbitrary-precision arithmetic unlimited size?

  • 02-12-2009 01:55AM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 1,430 ✭✭✭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