Hello,
How could I be able to process extremely long integers? I'm looking to handle integers in the order of 100 million digits..
Thanks
Hello,
How could I be able to process extremely long integers? I'm looking to handle integers in the order of 100 million digits..
Thanks
Can I install this on machines that I dont have root access to?
If they don't have a big number library already, persuade the admin it would be a great addition.
Without root access, I doubt if you can install it.
Integers with a hundred million digits in them??
What kind of data are you working with?
You can program up your own big number program, but it won't be as good as GNU's. Takes time and effort you may not want to spend.
Um, okay I've had a look at GMP... first thing is first... How could I tell if it's installed on the machine that it's working with... and secondly how would I actually use it? Is there a tutorial available anywhere?
Thanks
Okay I've got the first one cleared I think... the code compiles when I include <gmp.h>, so that probably means that it's installed... But is there a tutorial anywhere as to how I would implement it?
Thanks
Wikipedia has two article dealing with it, and then there's this:
The GNU MP Bignum Library
What about man command, does it have entries for the gimp?
This can be avoided by compiling with a static version of the library. :PWithout root access, I doubt if you can install it.
As far as tutorials go, there really aren't any. Just take a look at the online docs, it's straightforward.
1) Create a variable of type mpz_t
2) Assign it a value via integer, double, or string
3) Do operations
The big thing to keep in mind is that GMP is a C library, and does not overload operators. You have to call functions to add/multiply/set mpz_t. It's all explained in great detail in the manual though so you shouldn't have any trouble.
Consider this post signed
Why would you need root access to install a library? Just place it someplace in your home directory, then set LD_LIBRARY_PATH when you run the application that requires the library.
bit∙hub [bit-huhb] n. A source and destination for information.
I know this is the C forum, but if you can use C++, GMP has a C++ interface which is much easier to work with. You declare a integer variable like "mpz_class myInt;" and then you can use all the normal C operators instead of calling the mpz* functions (e.g., myInt*=2; etc.). The C++ interface is documented in the GMP manual.
I have an article that has some GMP examples -- both in C and C++ -- which shows how to work with both integers and floating-point numbers: How to Install and Run GMP on Windows Using MPIR - Exploring Binary (ignore the part about installing, since it sounds like you have it installed and are probably on Linux and not Windows anyhow -- just jump to the end for the examples).