Programming with large integers

AI Thread Summary
The discussion revolves around programming with large integers in Dev-C++, specifically for a Windows application that requires high precision for mathematical operations involving large numbers, such as exponentiation and modulus functions. Key points include the need for libraries beyond the standard Windows API to handle very large integers, with the GMP (GNU Multiple Precision Arithmetic Library) being a recommended option. Users seek guidance on integrating such libraries into their projects, particularly for beginners. There are mentions of other programming languages like Java, which has built-in support for large numbers, and inquiries about similar capabilities in Pascal and Visual Basic .NET for cryptographic applications. The conversation also touches on the possibility of creating custom integer classes to manage large numbers, emphasizing the importance of choosing the right data structure for efficiency. Overall, the need for precision in mathematical operations and the challenges of working with large integers in different programming environments are central to the discussion.
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.
 
Technology news on Phys.org
http://www.swox.com/gmp/ 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:
Thank you:smile:
 
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 ?
 
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?
 
Cryptography commonly uses libraries like GMP.. after all, most cryptography needs no more operations than exponentiation (mod some number) and multiplication.

- Warren
 
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.
 
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.
 
Get it here: http://swox.com/gmp/
 
Last edited by a moderator:

Similar threads

Replies
11
Views
2K
Replies
1
Views
3K
Replies
8
Views
2K
Replies
6
Views
2K
Replies
9
Views
2K
Replies
4
Views
4K
Replies
13
Views
3K
Back
Top