-1

I have data in mpz_t and I want to assign that data to int or unsigned long int. The data/numbers are small in mpz_t and can be stored into in back. Is there a way I can accomplish this?

Waqar
  • 8,558
  • 4
  • 35
  • 43

1 Answers1

1

Assuming you are referring to mpz_t from gmp(gnu multi-precision) library, you can do the conversion using:

unsigned long int mpz_get_ui (const mpz_t op)

Reference: https://gmplib.org/manual/Converting-Integers

Waqar
  • 8,558
  • 4
  • 35
  • 43