Exponents With C++ Wrapper

Torbjorn Granlund tg at gmplib.org
Wed May 13 09:00:42 CEST 2009


Henry <henryxxll at gmail.com> writes:

  Hello,First of all, this is an introduction e-mail, as I&#39;m new to the GMP community.So, on to my question.What I want to do is raise a small integer (single-digit) and raise it to a larger number (two or three digits). Neither of these are particularly large, but the answer certainly can be.
  The mpz_(ui)_pow(m)_ui function (described http://gmplib.org/manual/Integer-Exponentiation.html#Integer-Exponentiation) can be used for integer exponentiation in C. However, this doesn&#39;t work with mpz_class variables; just the mpz_t variables, which I can&#39;t figure out how to use in C++. I don&#39;t want to raise numbers to mpz_class-size integers, but I do want to recieve answers in that range. Is there a workaround, or just something I&#39;m missing?

As described in the manual, you can apply arbitrary mpz functions to
mpz_class variables.

-- 
Torbjörn


More information about the gmp-discuss mailing list