true if n is prime.
assert(isPrime(2)); assert(isPrime(3)); assert(isPrime(5)); assert(isPrime(7)); assert(isPrime(199UL)); assert(isPrime(104_729)); // 10,000th prime. assert(!isPrime(-199)); assert(!isPrime(-1)); assert(!isPrime(1)); // 1 is not a prime number: https://primes.utm.edu/notes/faq/one.html assert(!isPrime(4));
Checks if a number is prime.