inverse(_:)

Returns the multiplicative inverse of this integer in modulo modulus arithmetic, or nil if there is no such number.

GCD.swift:43
func inverse(_ modulus: BigUInt) -> BigUInt?

Returns

If gcd(self, modulus) == 1, the value returned is an integer a < modulus such that (a * self) % modulus == 1. If self and modulus aren’t coprime, the return value is nil.