Large Integer Arithmetic

BlitzMax Forums/BlitzMax Programming/Large Integer Arithmetic

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

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.

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.

Thanks! Exactly what I was looking for.

Does that mod use a whole byte just to store one digit?

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 :-)

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

I can imagine that my virtual memory page swapping would go into overdrive handling that number! ;)


It's only about 2GB :)