summaryrefslogtreecommitdiff
path: root/math/multInv.cpp
blob: f9db8157d626eb092e1a1b7121482ebf27a8b95c (plain)
1
2
3
4
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;
}