int:
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | Returns: true if n is prime. (All numbers < 2 return false).number to test. n)Primality test: tells if the argument is a (provable) prime or not. |
| public static int | Returns: the smallest prime greater than or equal to n.a positive number. n)Return the smallest prime greater than or equal to n. |
| public static List | Returns: list of prime factors of nnumber to factorize: must be ≥ 2 n)Prime factors decomposition |
| Primes | back to summary |
|---|---|
| private Primes() Hide utility class. | |
| isPrime | back to summary |
|---|---|
| public static boolean isPrime(int n) Primality test: tells if the argument is a (provable) prime or not. It uses the Miller-Rabin probabilistic test in such a way that a result is guaranteed: it uses the firsts prime numbers as successive base (see Handbook of applied cryptography by Menezes, table 4.1).
| |
| nextPrime | back to summary |
|---|---|
| public static int nextPrime(int n) Return the smallest prime greater than or equal to n.
| |
| primeFactors | back to summary |
|---|---|
| public static List Prime factors decomposition
| |