Function ADS::modInverse

Function Documentation

inline long long ADS::modInverse(long long s, long long m)

the p in [ 0 , m ) with p s mod m = 1; throws if gcd( s , m ) != 1

Pre:

m >= 1 and gcd( s , m ) = 1

Post:

s r = 1 modulo m