Texas Instruments interview question

Implement the power function.