pub fn mod_inv(a: i64, modulo: i64) -> i64
Expand description

Returns modular multiplicative inverse of a number. https://rosettacode.org/wiki/Modular_inverse#Rust

Arguments

  • a - A positive integer.
  • modulo - A positive integer.

Examples

use padic::mod_inv;
assert_eq!(mod_inv(42, 2017), 1969);