michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: =head1 NAME michael@0: michael@0: invmod - compute modular inverse of an integer michael@0: michael@0: =head1 SYNOPSIS michael@0: michael@0: invmod michael@0: michael@0: =head1 DESCRIPTION michael@0: michael@0: The B program computes the inverse of I, modulo I, if michael@0: that inverse exists. Both I and I are arbitrary-precision michael@0: integers in decimal notation. The result is written in standard michael@0: decimal notation to the standard output. michael@0: michael@0: If there is no inverse, the message: michael@0: michael@0: No inverse michael@0: michael@0: ...will be printed to the standard output (an inverse exists if and michael@0: only if the greatest common divisor of I and I is 1). michael@0: michael@0: =head1 SEE ALSO michael@0: michael@0: gcd(1), isprime(1), lap(1) michael@0: michael@0: =head1 AUTHOR michael@0: michael@0: Michael J. Fromberger michael@0: Thayer School of Engineering, Hanover, New Hampshire, USA