Big Numbers

I'm writing a factoring program and need to handle very large integers (larger that intmax). What is the best library to use for handling numbers like this? I have seen GMP, but it looks like it is made for Linux. I am using code::blocks on a 64-bit Windows machine.

Any suggestions are appreciated.
Thanks!
@joatmon

You can use unsigned long long, or unsigned _int64. Using only positive numbers, no negatives, the numbers portrayed can be unsigned long long OR unsigned _int64 | 0 to 18,446,744,073,709,551,615. I'm using unsigned _int64 in my hex to decimal program, converting FFFFFFFF ( 8 F's ) in hex, to 3,554,742,045 decimal. I'm sure you'll have no problems in your program.
Last edited on
Thanks. This might work. We are dealing with numbers that potentially have 30 digits, believe it or not.

I'd still like to get GMP to work, but I can't get the header files to compile.
@joatmon

Well, I hope this helps for awhile then. I, myself, have never heard of GMP. May I ask what that is, and what operating system, can use it? I have Windows 7, 64 bit. And lastly, where can I go to read up a bit about it, to see if it's anything I may be interested in using?
Last edited on
What I have been told is that GMP is a very popular library that can be used with C++ to allow "big number" functionality, up to hundreds of digits. It's supposed to be very fast and reliable. It was clearly designed for Linux, which is why using it for Windows seems to be a little difficult. Not as much information out there to explain it, but supposedly it can be done.
I think in C++ you can create your own data type, can't you?
Topic archived. No new replies allowed.