Fix another bug in the modular inverse

This commit is contained in:
Alexander Rosenberg 2024-10-07 20:54:07 -07:00
parent f154ef9b35
commit e8f351b7b3
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
2 changed files with 2 additions and 2 deletions

View File

@ -146,7 +146,7 @@ return a cons of (x . y) such char x * N1 + y * N2 = GCD."
integer i such that (N * i) mod M = 1."
(destructuring-bind (gcd (x . y))
(multiple-value-list (extended-gcd (if (minusp n)
(+ 26 n)
(+ m n)
n)
m))
(declare (ignorable y))

View File

@ -62,7 +62,7 @@ return a cons of (x . y) such char x * N1 + y * N2 = GCD."
integer i such that (N * i) mod M = 1."
(destructuring-bind (gcd (x . y))
(multiple-value-list (extended-gcd (if (minusp n)
(+ 26 n)
(+ m n)
n)
m))
(declare (ignorable y))