prime {spuRs} | R Documentation |
Function to assess whether or not an integer is prime.
Description
An inefficient, brute-force algorithm to assess whether or not an integer is prime.
Usage
prime(n)
Arguments
n |
The integer. |
Details
The function assumes that n
is a positive integer.
Value
The function returns a logical object that is TRUE if the integer is prime.
References
Jones, O.D., R. Maillardet, and A.P. Robinson. 2009. An Introduction to Scientific Programming and Simulation, Using R. Chapman And Hall/CRC.
See Also
Examples
prime(10)
prime(7)
[Package spuRs version 2.0.2 Index]