This is the cl-primality Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:17:08 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-primality
Primality testing
Zach Kost-Smith <zachkostsmith@gmail.com>
LLGPL (http://opensource.franz.com/preamble.html)
iterate
(system).
cl-primality.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-primality/cl-primality.lisp
cl-primality
(system).
*-mod
(function).
expt-mod-ref
(function).
miller-rabin
(function).
miller-rabin-pass
(function).
trial-division
(function).
Packages are listed by definition order.
cl-primality
common-lisp
.
iterate
.
*-mod
(function).
expt-mod-ref
(function).
miller-rabin
(function).
miller-rabin-pass
(function).
trial-division
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Raise B to the power of E, modulo MD (leave TOT as 1).
Generate a prime that is N-BITS long (less than 2^N-BITS). Just try random numbers of the right length until we find one that is prime (we use MILLER-RABIN for the test by default but it can be specified via PRIMEP-FN).
Determine if N is prime.
Multiply N by M, modulo MD.
A reference implementation, do not use except for testing purposes.
Miller-Rabin probabilistic primality test:
Checks if N is prime with the chance of a false positive less than CHANCE-OF-ERROR. This algorithm never gives false negatives.
Performs one ’pass’ of the Miller-Rabin primality algorithm.
Test for primality by effectively attempting to divide N by every integer between 2 and (/ N 2). This should not actually be used.
Jump to: | *
E F G M P T |
---|
Jump to: | *
E F G M P T |
---|
Jump to: | C F P S |
---|
Jump to: | C F P S |
---|