Last active
December 17, 2015 19:49
-
-
Save nitschmann/5663533 to your computer and use it in GitHub Desktop.
Simple recursive function for potency in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int potency(int basis, int exponent) { | |
if(exponent == 1) return basis; | |
else return this.potenz(basis, exponent-1)*basis; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment