source: CGBLisp/latex-doc/modular.tex@ 1

Last change on this file since 1 was 1, checked in by Marek Rychlik, 15 years ago

First import of a version circa 1997.

File size: 1.1 KB
Line 
1\begin{lisp:documentation}{modular$-$inverse}{FUNCTION}{x p }
2Find the inverse of X modulo prime P, using Euclid algorithm.
3\end{lisp:documentation}
4
5\begin{lisp:documentation}{modular$-$division}{FUNCTION}{x y p }
6Divide X by Y modulo prime P.
7\end{lisp:documentation}
8
9\begin{lisp:documentation}{*inverse$-$by$-$lookup$-$limit*}{VARIABLE}{100000 }
10If prime modulus is $<$ this number then the division algorithm
11will use a lookup table of inverses created at the time when
12field$-$modulo$-$prime is called.
13\end{lisp:documentation}
14
15\begin{lisp:documentation}{make$-$inverse$-$table}{FUNCTION}{modulus {\sf \&aux} (table (list 0)) }
16Make a vector of length MODULUS containing all inverses modulo
17MODULUS, which should be a prime number. The inverse of 0 is 0.
18\end{lisp:documentation}
19
20\begin{lisp:documentation}{make$-$modular$-$division}{FUNCTION}{modulus }
21Return a function of two arguments which will perform division
22modulo MODULUS. Currently, if MODULUS is $<$
23*INVERSE$-$BY$-$LOOKUP$-$LIMIT* then the returned function does table
24lookup, otherwise it uses the Euclid algorithm to find the inverse.
25\end{lisp:documentation}
26
Note: See TracBrowser for help on using the repository browser.