Module malachite_base::num::arithmetic::mod_power_of_2_inverse
source · Expand description
ModPowerOf2Inverse
, a trait for finding the multiplicative
inverse of a number modulo $2^k$.
§mod_inverse
use malachite_base::num::arithmetic::traits::ModPowerOf2Inverse;
assert_eq!(7u8.mod_power_of_2_inverse(4), Some(7));
assert_eq!(8u8.mod_power_of_2_inverse(4), None);
assert_eq!(123u32.mod_power_of_2_inverse(7), Some(51));