Use of mpz_mul_2exp

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


"Chris Saunders" <evas at mountaincable.net> 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
  operation.

Short example:

  mpz_mul_2exp (result, src, 38)

:-)

-- 
Torbjörn


More information about the gmp-discuss mailing list