Regarding power function
Wed, 12 Feb 2003 22:52:15 -0500
> Iam implementing a program using gmp lib. But i
>wasnt able to do a^b because gmp doesnt have that
>function where as it has a^b mod c.
> It would be great if any one of you would let me
>know is there any power function to calculate power of
>an mpz_t type of variable.
There is a function (mpz_pow_ui and mpz_ui_pow_ui). It take either a mpz or
unsigned integer as a base and have to be unsigned integer as exponent. The
reason for UI as exponent is that it would make no sense having too high
exponent. Ex, the maximum exponent with 32 bits unsigned is 4294967295
(2^32-1). And with lowest base (2), 2^4294967295 couldn't be allocated in
Help STOP SPAM with the new MSN 8 and get 2 months FREE*