The cl-prime-maker Reference Manual

This is the cl-prime-maker Reference Manual, version 0.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 15:35:18 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cl-prime-maker

A simple library to generate big prime numbers in a fast way. But in some cases, the generated number is not a prime number (these are called pseudo-primes). "The probability of mis-classifying a number is approximately 2^-100. So we can be fairly sure that the classification is correct."

Author

Xiaofeng Yang

License

BSD

Version

0.2

Source

cl-prime-maker.asd.

Child Components

3 Modules

Modules are listed depth-first from the system components tree.


3.1 cl-prime-maker/package-init

Source

cl-prime-maker.asd.

Parent Component

cl-prime-maker (system).

Child Component

packages.lisp (file).


3.2 cl-prime-maker/sources

Dependency

package-init (module).

Source

cl-prime-maker.asd.

Parent Component

cl-prime-maker (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 cl-prime-maker/cl-prime-maker.asd

Source

cl-prime-maker.asd.

Parent Component

cl-prime-maker (system).

ASDF Systems

cl-prime-maker.


4.1.2 cl-prime-maker/package-init/packages.lisp

Source

cl-prime-maker.asd.

Parent Component

package-init (module).

Packages

cl-prime-maker.


4.1.3 cl-prime-maker/sources/prime-maker.lisp

Source

cl-prime-maker.asd.

Parent Component

sources (module).

Public Interface
Internals

4.1.4 cl-prime-maker/sources/sm-ruiz-2000.lisp

Dependency

prime-maker.lisp (file).

Source

cl-prime-maker.asd.

Parent Component

sources (module).

Public Interface

get-nth-prime (function).

Internals

5 Packages

Packages are listed by definition order.


5.1 cl-prime-maker

Source

packages.lisp.

Use List

common-lisp.

Public Interface
Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Ordinary functions

Function: get-nth-prime (n)

Generate the Nth prime number when N >= 1. Otherwise this function always returns 2.

Package

cl-prime-maker.

Source

sm-ruiz-2000.lisp.

Function: make-prime (k)

Generates a random prime P with at least K decimal digits. Returns nil when k <= 0. Returns NIL otherwise. K should be an INTEGER.

Package

cl-prime-maker.

Source

prime-maker.lisp.

Function: primep (n)

Tests if N is a prime number. Returns T if N is a prime number. Returns NIL otherwise.
NOTES:
* If n <= 65535, the detection of whether a number is prime can always get the correct answer. * If n > 65535, the detection of whether a number is prime is based on the Fermat’s little theorem.

Package

cl-prime-maker.

Source

prime-maker.lisp.


6.2 Internals


6.2.1 Special variables

Special Variable: *ruiz-pis*
Package

cl-prime-maker.

Source

sm-ruiz-2000.lisp.

Special Variable: *ruiz-pis-part1*
Package

cl-prime-maker.

Source

sm-ruiz-2000.lisp.

Special Variable: *ruiz-results*
Package

cl-prime-maker.

Source

sm-ruiz-2000.lisp.

Special Variable: +primes-below-65535+
Package

cl-prime-maker.

Source

prime-maker.lisp.


6.2.2 Ordinary functions

Function: compute-ruiz-pi (k)
Package

cl-prime-maker.

Source

sm-ruiz-2000.lisp.

Function: compute-ruiz-pis-part1 (j)
Package

cl-prime-maker.

Source

sm-ruiz-2000.lisp.

Function: make (n)

make(n) -> I: Generates a random integer I with N decimal digits.

Package

cl-prime-maker.

Source

prime-maker.lisp.

Function: make-prime-list-for-range (maximum)
Package

cl-prime-maker.

Source

prime-maker.lisp.

Function: make-prime/2 (k p)
Package

cl-prime-maker.

Source

prime-maker.lisp.

Function: make/2 (n d)
Package

cl-prime-maker.

Source

prime-maker.lisp.

Function: new-seed ()
Package

cl-prime-maker.

Source

prime-maker.lisp.

Function: pow (a b m)

Computes V = (A^B) mod M. It’s much faster than (mod (expt a b) m).

Package

cl-prime-maker.

Source

prime-maker.lisp.

Function: primep/2 (d ntests)
Package

cl-prime-maker.

Source

prime-maker.lisp.

Function: primep/3 (ntest n len)
Package

cl-prime-maker.

Source

prime-maker.lisp.

Function: random-uniform (n)
Package

cl-prime-maker.

Source

prime-maker.lisp.


Appendix A Indexes


A.1 Concepts