Skip to content

Instantly share code, notes, and snippets.

@MohammedRashad
Created November 20, 2016 20:37
Show Gist options
  • Save MohammedRashad/0652999df7bc3002b3b3c242a7273aab to your computer and use it in GitHub Desktop.
Save MohammedRashad/0652999df7bc3002b3b3c242a7273aab to your computer and use it in GitHub Desktop.
calculate the power of any integer
uint32_t power(uint32_t n,uint32_t m){
if (m == 0) return 1;
if (m == 1) return n;
return n * power(m - 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment