public final class PrimalityUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isPrime(long number)
Determines whether a given value is prime.
|
static boolean |
isPrime(Long number)
Determines whether a given value is prime.
|
static long |
nthPrime(int n)
Returns nth prime number.
|
static long |
nthPrime(Integer n)
Returns nth prime number.
|
public static boolean isPrime(@Nonnull Long number)
number - Number to determine primality of. Must be non-null.public static boolean isPrime(long number)
number - Number to determine primality of.public static long nthPrime(@Nonnegative @Nonnull Integer n)
n - which prime number to compute. Example: if n is 6, computes the 6th prime number. Must be non-nullpublic static long nthPrime(@Nonnegative int n)
n - which prime number to compute. Example: if n is 6, computes the 6th prime number.Copyright © 2015. All rights reserved.