Skip to content

Commit 8ba3566

Browse files
Merge pull request #4189 from brebenelmihnea/Modular-Inverse
Minor Fix
2 parents 5f63684 + 1fbf225 commit 8ba3566

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/4_Gold/Modular.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ assert 2 * x % MOD == 1
292292
We can also find modular inverses through Euclidean Division.
293293
Given the prime modulus $m > a$ we have:
294294
$m = k \cdot a + r$, where k = $floor(\frac{m}{a})$ and $r = m \mod a$. Then: $0 = k \cdot a + r \mod m \iff r = -k \cdot a \mod m
295-
\iff r \cdot a^-1 = -k \mod m \iff a^-1 = -k \mod m \cdot r^-1 \mod m$.
295+
\iff r \cdot a^{-1} = -k \mod m \iff a^{-1} = -k \cdot r^{-1} \mod m$.
296296
297297
Here is a short recursive implementation of the above formula:
298298

0 commit comments

Comments
 (0)