|
1 # This Source Code Form is subject to the terms of the Mozilla Public |
|
2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
4 |
|
5 =head1 NAME |
|
6 |
|
7 invmod - compute modular inverse of an integer |
|
8 |
|
9 =head1 SYNOPSIS |
|
10 |
|
11 invmod <a> <m> |
|
12 |
|
13 =head1 DESCRIPTION |
|
14 |
|
15 The B<invmod> program computes the inverse of I<a>, modulo I<m>, if |
|
16 that inverse exists. Both I<a> and I<m> are arbitrary-precision |
|
17 integers in decimal notation. The result is written in standard |
|
18 decimal notation to the standard output. |
|
19 |
|
20 If there is no inverse, the message: |
|
21 |
|
22 No inverse |
|
23 |
|
24 ...will be printed to the standard output (an inverse exists if and |
|
25 only if the greatest common divisor of I<a> and I<m> is 1). |
|
26 |
|
27 =head1 SEE ALSO |
|
28 |
|
29 gcd(1), isprime(1), lap(1) |
|
30 |
|
31 =head1 AUTHOR |
|
32 |
|
33 Michael J. Fromberger <sting@linguist.dartmouth.edu> |
|
34 Thayer School of Engineering, Hanover, New Hampshire, USA |