Programming with large integers

1. Jun 18, 2006

finchie_88

Hi all, I'm doing a little programming at the moment using Dev-C++. I'm writing a windows program, and have all of the stuff like menus, dialog boxs etc sorted out, and now need to get onto the programming that makes the program achieve something. In the program I will be dealing with very large numbers (at first about 50 to 75 digit numbers, but I am hoping to extend this to around 150 digits once I have a working prototype). I will be doing mathematics with only integers, and will be doing large exponentials (a^(a very large number)), and modulus functions; however, I need near perfect precision, so no rounding. My questions are:
1. Are there any libaries that I will need (or could use) that are not included in the standard windows API? (this may be a difficult question to answer, since this depends on IDE and updates but try your best anyway).
2. How would I integrate them into my program? (Again a bit vague given that I haven't actually said what my program will do).

Any help would be kind, thank you.

2. Jun 18, 2006

Hurkyl

Staff Emeritus
http://www.swox.com/gmp/ [Broken] is a commonly used big number library.

It's not relevant here, but Java has built-in big number support -- BigInteger.

Last edited by a moderator: May 2, 2017
3. Jun 19, 2006

finchie_88

Thank you

4. Jun 27, 2006

arunbg

I am a beginner in programming and I have no clue as to how to integrate GMP with my turbo C++ ( the manual wasn't very helpful ). Can someone give me a walkthrough please ?

5. Jul 13, 2006

mtanti

Yes it would be nice if anyone can help me on the same subject as well. I'm programming an encryption algorithm that requires working with enormous numbers (hundreds of thousands of digits or at least 500 digits to be practicle and less secure). How do I do that in Pascal or Visual Basic .NET? I need a -MANTISSA- that is that long and not a stupid 12 digit mantissa with a large exponent...

Also since we're on the subject, how the heck do they perform operations on the keys in public key cryptography?

6. Jul 13, 2006

chroot

Staff Emeritus
Cryptography commonly uses libraries like GMP.. after all, most cryptography needs no more operations than exponentiation (mod some number) and multiplication.

- Warren

7. Jul 13, 2006

neurocomp2003

create your own integer class that handles N-bit binary numbers(easily converted so some N-digit decimal. Eberly has a pretty easy to read Integer class. One of the questions you need to ask is do you want to store the memory as a binary number or as a string of digits. When you decide on that then the operations them selves will be easy to code.

8. Jul 14, 2006

mtanti

And where can I get this GMP?

So coding your own operations is the only way? No 'in-built' method? It would be mega slow that way rather than using assembly instructions.

9. Jul 14, 2006

imabug

Get it here: http://swox.com/gmp/ [Broken]

Last edited by a moderator: May 2, 2017