File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -21,26 +21,28 @@ public static int binPow(int a, int p) {
21
21
return res ;
22
22
}
23
23
24
- /**
24
+ /**
25
25
* Function for testing binary exponentiation
26
- * @param a the base
26
+ *
27
+ * @param a the base
27
28
* @param p the exponent
28
29
*/
29
- public static void test (int a , int p ) {
30
+ public static void test (int a , int p ) {
30
31
int res = binPow (a , p );
31
32
assert res == (int ) Math .pow (a , p ) : "Incorrect Implementation" ;
32
33
System .out .println (a + "^" + p + ": " + res );
33
34
}
34
35
35
- /** Main Function to call tests
36
- *
36
+ /**
37
+ * Main Function to call tests
38
+ *
37
39
* @param args System Line Arguments
38
40
*/
39
41
public static void main (String [] args ) {
40
42
// prints 2^15: 32768
41
- test (2 , 15 );
43
+ test (2 , 15 );
42
44
43
45
// prints 3^9: 19683
44
- test (3 ,9 );
46
+ test (3 , 9 );
45
47
}
46
48
}
You can’t perform that action at this time.
0 commit comments