Pick up an hex digit from a mpz_t integer

Ramón T. B. framontb at yahoo.es
Sat Jul 27 19:19:54 CEST 2013


Hello all,

   I need a function to pick up an hex digit from a mpz_t integer. For example:

int pick_hex(mpz_t number, int position);

For example:
number = "123456789abcdef";
position = 3;
solution = pick_hex(number, position);  // solution = c

How I can achieve that?

Thanks in advance !


More information about the gmp-discuss mailing list