Next: , Previous: , Up: Integer Functions   [Index]


5.7 Exponentiation Functions

Function: 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, mpir_ui exp, mpz_t mod)

Set rop to (base raised to exp) modulo mod.

A negative exp is supported in mpz_powm 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.

Function: void mpz_pow_ui (mpz_t rop, mpz_t base, mpir_ui exp)
Function: void mpz_ui_pow_ui (mpz_t rop, mpir_ui base, mpir_ui exp)

Set rop to base raised to exp. The case 0^0 yields 1.