summaryrefslogtreecommitdiffstats
path: root/modular.txi
diff options
context:
space:
mode:
authorThomas Bushnell, BSG <tb@debian.org>2005-11-02 14:55:21 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:32 -0800
commit34c54a22ff7818bb8b38ef4d9c87dbbcb221ba73 (patch)
tree1189d06a81277bcf8539b0260a69a19f6038effb /modular.txi
parent611b3db17894e5fdc0db3d49eaf6743d27b44233 (diff)
parent5145dd3aa0c02c9fc496d1432fc4410674206e1d (diff)
downloadslib-34c54a22ff7818bb8b38ef4d9c87dbbcb221ba73.tar.gz
slib-34c54a22ff7818bb8b38ef4d9c87dbbcb221ba73.zip
Import Debian changes 3a2-1debian/3a2-1
slib (3a2-1) unstable; urgency=low * New upstream release. * Acknowledge NMU. (Closes: #281809) * Makefile: Don't hack Makefile; use rules instead. * debian/rules: Set on make invocations: prefix, htmldir, TEXI2HTML. * debian/rules (clean): Clean more stuff here. * Makefile: Comment out old rule for $(htmldir)slib_toc.html. Instead, specify directly that the texi2html invocation produces that file. * debian/rules (binary-indep): Find web files in slib subdir. * debian/control (Build-Depends-Indep): Go back to using scm.
Diffstat (limited to 'modular.txi')
-rw-r--r--modular.txi12
1 files changed, 12 insertions, 0 deletions
diff --git a/modular.txi b/modular.txi
index d947b35..bf2cd52 100644
--- a/modular.txi
+++ b/modular.txi
@@ -26,28 +26,33 @@ If @var{x1} and @var{x2} are integers, then @code{mod} behaves like
@end format
@end defun
+
@defun extended-euclid n1 n2
Returns a list of 3 integers @code{(d x y)} such that d = gcd(@var{n1},
@var{n2}) = @var{n1} * x + @var{n2} * y.
@end defun
+
@defun symmetric:modulus n
Returns @code{(quotient (+ -1 n) -2)} for positive odd integer @var{n}.
@end defun
+
@defun modulus->integer modulus
Returns the non-negative integer characteristic of the ring formed when
@var{modulus} is used with @code{modular:} procedures.
@end defun
+
@defun modular:normalize modulus n
Returns the integer @code{(modulo @var{n} (modulus->integer
@var{modulus}))} in the representation specified by @var{modulus}.
@end defun
+
@noindent
The rest of these functions assume normalized arguments; That is, the
arguments are constrained by the following table:
@@ -79,27 +84,32 @@ Returns @code{#t} if there exists an integer n such that @var{k} * n
@equiv{} 1 mod @var{modulus}, and @code{#f} otherwise.
@end defun
+
@defun modular:invert modulus n2
Returns an integer n such that 1 = (n * @var{n2}) mod @var{modulus}. If
@var{n2} has no inverse mod @var{modulus} an error is signaled.
@end defun
+
@defun modular:negate modulus n2
Returns (@minus{}@var{n2}) mod @var{modulus}.
@end defun
+
@defun modular:+ modulus n2 n3
Returns (@var{n2} + @var{n3}) mod @var{modulus}.
@end defun
+
@defun modular:- modulus n2 n3
Returns (@var{n2} @minus{} @var{n3}) mod @var{modulus}.
@end defun
+
@defun modular:* modulus n2 n3
Returns (@var{n2} * @var{n3}) mod @var{modulus}.
@@ -108,7 +118,9 @@ The Scheme code for @code{modular:*} with negative @var{modulus} is
not completed for fixnum-only implementations.
@end defun
+
@defun modular:expt modulus n2 n3
Returns (@var{n2} ^ @var{n3}) mod @var{modulus}.
@end defun
+