You are on page 1of 1

You might also consider using mpz_class in C++ (ref.) rather than mpz_t.

It can make
arbitrary precision arithmetic straightforward.
Here's a random example:
#include <gmp.h>
#include <gmpxx.h>
#include <iostream>
using namespace std;
int main() {
mpz_class A[100000];
for(int i=0;i<100000;i++) A[i]=142412+i;
for(int i=0;i<100000;i++) cout << i << " " << A[i] << endl;
}

return 0;

You might also like