How to calculate
Solve ax + my = gcd(a,m). If the GCD is one, reduce x modulo m to obtain the inverse. Otherwise no inverse exists.
Worked example
Use Integer 7 · Modulus 29 · Inverse type Multiplicative. The result is 25.
Input and result notes
Use a modulus of at least 2. The inverse is returned as the least nonnegative residue.