Test the number given for primality.

isPrime(n)

Arguments

n

n

Value

boolean TRUE if n is prime, FALSE if not

Details

This function tests n if it is prime through repeated division attempts. If a match is found, by finding a remainder of 0, FALSE is returned.

See also

Examples

isPrime(37)
#> [1] TRUE
isPrime(89)
#> [1] TRUE
isPrime(100)
#> [1] FALSE