pub trait ModInverse<R: Sized>: Sized {
type Output: Sized;
// Required method
fn mod_inverse(self, m: R) -> Option<Self::Output>;
}Expand description
Generic trait to implement modular inverse.
Required Associated Types§
Required Methods§
Sourcefn mod_inverse(self, m: R) -> Option<Self::Output>
fn mod_inverse(self, m: R) -> Option<Self::Output>
Function to calculate the modular multiplicative inverse of an integer a modulo m.
TODO: references
Returns the modular inverse of self.
If none exists it returns None.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.