mpz_cbrtrem

Kevin Ryde user42@zip.com.au
Sun, 10 Nov 2002 07:46:53 +1000


Paul Zimmermann <Paul.Zimmermann@loria.fr> writes:
>
> The key function is mpz_add_bits: set the low bits of the destination
> to bits n0 to n1-1 from the operand.

A sort of bit copy between mpz's I see.  The mpn_rshift you've got is
probably the best way.

>       int k2 = k / 2;
>       mpz_cbrtrem_aux (s, k - k2, r, n, n0 + 3 * k2, n1, q, t);

I guess that could become an iteration without too much trouble.

>       mpz_mul_ui (t, s, 3); /* 3*s */

Another use for an mpn_addlshift.  A few dozen more and we might have
to implement it :-).