summaryrefslogtreecommitdiff
path: root/content/math/multInv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'content/math/multInv.cpp')
-rw-r--r--content/math/multInv.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/content/math/multInv.cpp b/content/math/multInv.cpp
new file mode 100644
index 0000000..647dc2d
--- /dev/null
+++ b/content/math/multInv.cpp
@@ -0,0 +1,4 @@
+ll multInv(ll x, ll m) {
+ auto [d, a, b] = extendedEuclid(x, m); // Implementierung von oben.
+ return ((a % m) + m) % m;
+}