Reading integer internals
Uros Miletic
urosmiletic at hotmail.com
Sun Jun 4 23:21:17 CEST 2006
Hi
im having one problem that i couldnt overcome for some time. I need to
implement some functions that will test integer numbers, and i need to do it
as effective as possible.
For examle, one of the functions is testing the 1024th bit of an integer
number. I could use the standard gmp bit functions, but why not simply read
the 32nd limb (bits per limb are equal to 32 on my system) and then get its
msb.
I would be gratefull if somebody can explain to me how to access the _mp_d
field of a standard mpz_t and read individual limbs.
Thanks
Uros
More information about the gmp-discuss
mailing list