mpz_sizeinbase and mpz_root

Jason Moxham
Fri, 1 Nov 2002 22:02:17 +0000

I notice that=20

int mpz_root (mpz_t x , mpz_t y , unsigned long k ) when k=3D2 does not c=
all the=20
sqrt fn's  which are much faster than general k'th root , I suppose this=20
could be added as small patch , if it was thought that the case k=3D2 is =
enough ?

same comment for mpz_sizeinbase(mpz_t x, unsigned long k) when k=3D2
by using count_leading_zeros and not the bases[] tables , I was suprised =
it was that much faster  , in the current code we have an useless divisio=
n by=20
1 , which the compiler doesn't recognize. The case k=3D2 must be fairly c=
as it can be used for log_base2 .