From ca740ed7caeca4deb09a2fc7912f599555442e15 Mon Sep 17 00:00:00 2001 From: Paul Jungeblut Date: Sat, 22 Nov 2014 11:46:50 +0100 Subject: bisschen LGS --- math/multInv.cpp | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 math/multInv.cpp (limited to 'math/multInv.cpp') diff --git a/math/multInv.cpp b/math/multInv.cpp new file mode 100644 index 0000000..f9db815 --- /dev/null +++ b/math/multInv.cpp @@ -0,0 +1,5 @@ +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 -- cgit v1.2.3