isPrime: Prime number test

Description Usage Arguments Details Value Examples

View source: R/isPrime.R

Description

Tests if a given number is prime and returns TRUE or FALSE

Usage

1

Arguments

v

the number to be tested for primality

Details

Tests for the primality of any positive integer using the fact that all primes except 2 and 3 can be expressed as 6k-1 or 6k+1 for integer k.

Value

logical TRUE or FALSE

Examples

1
2
3
4
isPrime(731563)
isPrime(7315631)
isPrime(31**2)
 

blocksdesign documentation built on April 8, 2021, 1:07 a.m.