The Function Pow of X To the Y
pow(x,y)
You can create a function to relate
the value of x raised to power y.
One clever way to exponentiate
is to repeat a simple multiply.
If y is zero, just return a one—
for ev’ry number, that will be the case.
And when y equals one, your work is done—
the answer will be x, your starting base.
For ev’ry other value y can be,
just multiply by x, recursively.
Copyright © J-Mag Guthrie | Year Posted 2017
Post Comments
Poetrysoup is an environment of encouragement and growth so only provide specific positive comments that indicate what you appreciate about the poem. Negative comments will result your account being banned.
Please
Login
to post a comment