A Faster Exponentiation Algorithm by Squaring (Power Function) December 17, 2012 algorithms, math, programming languages, python No Comments If we want to compute , we can have a naive implementation by multiplication of base number x. def pow(x, n): r = 1 for _ in xrange(n): r *= … [Continue Reading...]