Vocabulary
math.functions

Inputs
xan integer
nan integer


Outputs
yan integer


Word description
Outputs an integer y such that xy = 1 (mod n).

Errors
Throws an error if n is not invertible modulo n.

Examples
USING: math.functions prettyprint ; 173 1119 mod-inv .
815

USING: math prettyprint ; 173 815 * 1119 mod .
1


Definition