fermat.test: Test an integer for primality with Fermat's little theorem

Description Usage Arguments Details Value Note Author(s) References

Description

This is an example function for making R packages and R documentation with roxygen2 and roxygenize.

Usage

1

Arguments

n

the integer to test for primality

Details

Fermat's little theorem states that if n is a prime number and a is any positive integer less than n, then a raised to the nth power is congruent to a modulo n.

Value

Whether the integer passes the Fermat test for a randomized 0 < a < n no workyATcallGraphPrimitives

Note

fermat.test doesn't work for integers above approximately fifteen because modulus loses precision.

Author(s)

Peter Danenberg pcd@roxygen.org

References

http://en.wikipedia.org/wiki/Fermat's_little_theorem


modiscloud documentation built on May 2, 2019, 5:19 p.m.