Underlying Idea
Using the following observation, one can create a recursive algorithm that computes xn for an integer n using squaring and multiplication:
A brief analysis shows that such an algorithm uses log2n squarings and at most log2n multiplications. For n > about 4 this is computationally more efficient than naïvely multiplying the base with itself repeatedly.
Read more about this topic: Exponentiation By Squaring
Famous quotes containing the words underlying and/or idea:
“Sport in the sense of a mass-spectacle, with death to add to the underlying excitement, comes into existence when a population has been drilled and regimented and depressed to such an extent that it needs at least a vicarious participation in difficult feats of strength or skill or heroism in order to sustain its waning life-sense.”
—Lewis Mumford (18951990)
“I have no patience with this dreadful idea that whatever you have in you has to come out, that you cant suppress true talent. People can be destroyed; they can be bent, distorted, and completely crippled.”
—Katherine Anne Porter (18901980)