A newbie question

Bird, John John.Bird at ca.com
Mon Aug 17 04:09:31 CEST 2009


Hi Guys

 

I'm looking through the manual for a function that pulls out the Xth
digit of an int.

So something like this:

 

unsigned long uslong;

 

mpz_set_str(n, "111111111111111911111", 10);

uslong = mpz_get_index_ui(n, 5);

 

uslong would now equal 9

 

The closest thing in the manual I can find is mpz_getlimbn. Is this the
function I am looking for? If so, can anyone suggest an efficient way of
calculating an "index" from that?

 

Many thanks,

John



More information about the gmp-discuss mailing list