fixing power for nonnegative integers
Merge pull request #8661 from kaushik94/nonnegative-power

fixing power for nonnegative integers