finding MSB ?? Best way or is there a function?

Kevin Ryde user42 at
Sat Dec 13 08:38:56 CET 2003

Ernst Berg <ernst_berg at> writes:
> I have been looking for a way to find the MSB of mpz_t
> in GMP.

mpz_sizeinbase(z,2) is what you want (for a positive number at least).

I'll add an index entry to the manual.

More information about the gmp-discuss mailing list