The modular multiplicative inverse of an integer amodulo m is an integer x such that
That is, it is the multiplicative inverse in the ring of integers modulo m. This is equivalent to
The multiplicative inverse of a modulo m exists iff a and m are coprime (i.e., if gcd(a, m) = 1). If the modular multiplicative inverse of amodulo m exists, the operation of division by amodulo m can be defined as multiplying by the inverse, which is in essence the same concept as division in the field of reals.