www.delorie.com/gnu/docs/gmp/gmp_34.html   search  
 
Buy GNU books!


GNU MP 4.1.2

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [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, unsigned long int exp, mpz_t mod)
Set rop to \N\ \bmod mod, (base raised to exp) modulo mod}.

Negative exp is supported if an inverse base^-1 mod mod exists (see mpz_invert in 5.9 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, unsigned long int exp)
Function: void mpz_ui_pow_ui (mpz_t rop, unsigned long int base, unsigned long int exp)
Set rop to \N\, base raised to exp}. The case 0^0 yields 1.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003