Skip to content

Commit

Permalink
small changes to power
Browse files Browse the repository at this point in the history
  • Loading branch information
loucadufault committed May 4, 2019
1 parent ecd95ff commit 5a27212
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Algorithms/power/src/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ public static int recursivePower(int base, int power) {
}

public static void main(String[] args) {
Random random = new Random();
final int RANGE = 10;

Random random = new Random();
int testBase = random.nextInt(RANGE);
int testPower = random.nextInt(RANGE);

Expand All @@ -28,7 +29,7 @@ public static void main(String[] args) {

assert (iterativeResult == recursiveResult);
int result = iterativeResult;

System.out.println("Calculating " + testBase + "^" + testPower);
System.out.println("= " + result);
}
Expand Down

0 comments on commit 5a27212

Please sign in to comment.