Algolib
Data structures
Graphs
Geometry
Mathematics
Exponentiation by squaring
getPower()
Fraction
GCD / LCM
Matrix
Modulo
Permutation
Polynomial
Prime decomposition
Sieve of Eratosthenes
Optimization
Sorting
Strings
Trees
Simplex
Two-SAT
JSON
Constants
Shortcuts
Utility
Algolib
Mathematics
Exponentiation by squaring
View page source
Exponentiation by squaring
Functions
template
<
class
T
>
T
getPower
(
const
T
&
x
,
const
int
p
)
Exponentiation by squaring (p must be strictly positive)