pub fn modular_inverse(a: u64, m: u64) -> Option<u64>Expand description
Modular multiplicative inverse: a^-1 mod m.
Returns None if a and m are not coprime.
§Examples
use mathverse_core::integer::modular_inverse;
assert_eq!(modular_inverse(3, 11), Some(4)); // 3 * 4 = 12 ≡ 1 (mod 11)
assert_eq!(modular_inverse(2, 4), None);