Learn R Programming

cmna (version 1.0.0)

isPrime: Test for Primality

Description

Test the number given for primality.

Usage

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

Other algebra: bilinear, cubicspline, division, fibonacci, horner, linterp, nthroot, polyinterp, pwiselinterp, quadratic

Examples

Run this code
# NOT RUN {
isPrime(37)
isPrime(89)
isPrime(100)

# }

Run the code above in your browser using DataLab