Use of mpz_mul_2exp

Torbjorn Granlund tg at
Mon Mar 22 20:09:22 CET 2010

"Chris Saunders" <evas at> writes:

  I am working an interface to GMP for the language Eiffel.  I was
  attempting to implement a left shift operation using mpz_mul_2exp and
  am not getting the result I expected.

What's the problem?

  I'm hoping someone could write
  me a short example in C of using mpz_mul_2exp to do a left shift

Short example:

  mpz_mul_2exp (result, src, 38)



More information about the gmp-discuss mailing list