summaryrefslogtreecommitdiff
path: root/math/multInv.cpp
diff options
context:
space:
mode:
authorPaul Jungeblut <paul.jungeblut@gmail.com>2016-06-27 11:17:34 +0200
committerPaul Jungeblut <paul.jungeblut@gmail.com>2016-06-27 11:17:34 +0200
commit9e625b89bac7e8daaf583e215f3a0df3dc250bb2 (patch)
treeab295455fce73f726bd97a325a61d95aca77a508 /math/multInv.cpp
parent5bb1ac05882e0df43a2afe0c363e0f503f51c357 (diff)
Math section rebuild, merged convinience and sonstiges section.
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
+}