We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7bd323e commit b836c44Copy full SHA for b836c44
src/com/codefortomorrow/advanced/chapter13/solutions/PrimePractice.java
@@ -33,7 +33,12 @@ public static void main(String[] args) {
33
}
34
35
36
- //n is the number to check, z is the current number being divided
+ /**
37
+ * isPrime checks the primality of a given integer
38
+ * @param n The integer to check
39
+ * @param z Current Divisor(used for recursion)
40
+ * @return boolean true if prime and false if not
41
+ */
42
public static boolean isPrime(int n, int z) {
43
//Check base cases
44
if (n <= 2) return (n == 2) ? true : false;
0 commit comments