Skip to content

Commit 6b0c865

Browse files
I swear this is the last
1 parent 8ffd36d commit 6b0c865

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)