Normal Powering Algorithm (GNU MP 6.2.1)
Description: How to install and use the GNU multiple precision arithmetic library, version 6.2.1.

Next: Modular Powering Algorithm, Previous: Powering Algorithms, Up: Powering Algorithms [Index]

#### 15.4.1 Normal Powering

Normal `mpz` or `mpf` powering uses a simple binary algorithm, successively squaring and then multiplying by the base when a 1 bit is seen in the exponent, as per Knuth section 4.6.3. The “left to right” variant described there is used rather than algorithm A, since it’s just as easy and can be done with somewhat less temporary memory.