Need to find a C++ library

GEC: Discuss gaming, computers and electronics and venture into the bizarre world of STGODs.

Moderator: Thanas

Post Reply
User avatar
Jaepheth
Jedi Master
Posts: 1055
Joined: 2004-03-18 02:13am
Location: between epsilon and zero

Need to find a C++ library

Post by Jaepheth »

I'm doing a bit of research into some number theory and I require the ability to do simple arithmetic with large integer numbers (up to 2048 bits).

Does anyone know of any simple-to-use large integer libraries? All the ones I've downloaded so far won't compile (could be my compiler's too old or I'm not implementing them properly, I'm a bit of a programming noob)

I only need addition, subtraction, multiplication and modulos operators
Children of the Ancients
I'm sorry, but the number you have dialed is imaginary. Please rotate the phone by 90 degrees and try again.
User avatar
Pint0 Xtreme
Jedi Council Member
Posts: 2430
Joined: 2004-12-14 01:40am
Location: The City of Angels
Contact:

Post by Pint0 Xtreme »

You could always convert those integers into a larger number base. :P
Image
User avatar
ThatGuyFromThatPlace
Jedi Knight
Posts: 691
Joined: 2006-08-21 12:52am

Post by ThatGuyFromThatPlace »

MS Visual C++ Express edition comes with a very nice library, not sure if it has what you want but its worth checking out.
[img=right]http://www.geocities.com/jamealbeluvien/revolution.jpg[/img]"Nothing here is what it seems. You are not the plucky hero, the Alliance is not an evil empire, and this is not the grand arena."
- The Operative, Serenity
"Everything they've ever "known" has been proven to be wrong. A thousand years ago everybody knew as a fact, that the earth was the center of the universe. Five hundred years ago, they knew it was flat. Fifteen minutes ago, you knew we humans were alone on it. Imagine what you'll know tomorrow."
-Agent Kay, Men In Black
User avatar
Kane Starkiller
Jedi Council Member
Posts: 1510
Joined: 2005-01-21 01:39pm

Post by Kane Starkiller »

Hm, well I used this class but it is written for C#.
But if the forces of evil should rise again, to cast a shadow on the heart of the city.
Call me. -Batman
User avatar
phongn
Rebel Leader
Posts: 18487
Joined: 2002-07-03 11:11pm

Post by phongn »

Take a look at Boost's BigInt implementation - it is still in the sandbox but AFAIK it should still work well

EDIT: Also, take a look at GMP or NTL
Post Reply