Skip to content

Instantly share code, notes, and snippets.

@nitschmann
Last active December 17, 2015 19:49
Show Gist options
  • Save nitschmann/5663533 to your computer and use it in GitHub Desktop.
Save nitschmann/5663533 to your computer and use it in GitHub Desktop.
Simple recursive function for potency in Java
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