I woke up this morning, feeling great.
I thought to myself, I'll self-inflate,
and proceeded to exponentiate.
I sure was the man.
Just as I was hitting my rhythm,
in a gesture of antagonism,
sheriff John Brown took my logarithm.
I was back where I began.
Categories:
exponentiate, math, silly,
Form: Rhyme
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.
Categories:
exponentiate, computer, math,
Form: Verse