Exponentiation by squaring

Functions

template<class T>
T getPower(const T &x, const int p)

Exponentiation by squaring (p must be strictly positive)