summaryrefslogtreecommitdiff
path: root/math/multInv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'math/multInv.cpp')
-rw-r--r--math/multInv.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/math/multInv.cpp b/math/multInv.cpp
index f9db815..858e47c 100644
--- a/math/multInv.cpp
+++ b/math/multInv.cpp
@@ -1,5 +1,6 @@
-ll multInv(ll n, ll p) { //berechnet das multiplikative Inverse von n in F_p
- extendedEuclid(n, p); //implementierung von oben
+// Laufzeit: O(log (n) + log(p))
+ll multInv(ll n, ll p) { // Berechnet das multiplikative Inverse von n in F_p.
+ extendedEuclid(n, p); // Implementierung von oben.
x += ((x / p) + 1) * p;
return x % p;
-} \ No newline at end of file
+}