Large Integer Arithmetic

BlitzMax Forums/BlitzMax Programming/Large Integer Arithmetic

Otus(Posted 2008) [#1]
Does anyone have a type or a set of functions for large integer arithmetic like bignum (http://en.wikipedia.org/wiki/Bignum) or something alike? Couldn't find any from the code archives.


Brucey(Posted 2008) [#2]
There's a module which can handle numbers with up to 2,147,483,647 digits : http://code.google.com/p/maxmods/wiki/MapmModule

That qualifies for a reasonably large integer.


Otus(Posted 2008) [#3]
Thanks! Exactly what I was looking for.


Azathoth(Posted 2008) [#4]
Does that mod use a whole byte just to store one digit?


Brucey(Posted 2008) [#5]
I believe so, yes. It was the best non-GPL'd library I could find.

You are always free to write your own, of course :-)


Russell(Posted 2008) [#6]
Dude, that's 2 *BILLION* digits! I can imagine that my virtual memory page swapping would go into overdrive handling that number! ;)

Thanks for wrapping the code, though, Brucey! (BRL should have you on their payroll, if you ask me...)

Russell


Perturbatio(Posted 2008) [#7]
I can imagine that my virtual memory page swapping would go into overdrive handling that number! ;)


It's only about 2GB :)