Node:Integer Exponentiation, Next:, Previous:Integer Division, Up:Integer Functions



Exponentiation Functions

void mpz_powm (mpz_t rop, mpz_t base, mpz_t exp, mpz_t mod) Function
void mpz_powm_ui (mpz_t rop, mpz_t base, unsigned long int exp, mpz_t mod) Function
Set rop to (base raised to exp) modulo mod.

Negative exp is supported if an inverse base^-1 mod mod exists (see mpz_invert in Number Theoretic Functions). If an inverse doesn't exist then a divide by zero is raised.

void mpz_pow_ui (mpz_t rop, mpz_t base, unsigned long int exp) Function
void mpz_ui_pow_ui (mpz_t rop, unsigned long int base, unsigned long int exp) Function
Set rop to base raised to exp. The case 0^0 yields 1.