pub trait DivExactAssign<Rhs, Precompute>: Sized {
// Required method
fn div_exact_assign(&mut self, d: Rhs, pre: &Precompute) -> bool;
}Expand description
Exact division, re-exported from num-modular.
DivExact<Rhs, Precompute>::div_exact(self, rhs, pre) returns Some(self / rhs) when rhs
divides self exactly and None otherwise. dashu’s implementations use the empty
precomputation Precompute = () (pass &() at the call site). For arbitrary-precision types an
exact division avoids the general division’s normalization and remainder computation when the
divisor is small (e.g. dashu-int uses Hensel 2-adic division).
In-place exact division, with precomputed helper values
This is the assign version of DivExact: if d divides self, self is replaced by
the quotient and true is returned; otherwise self is unchanged and false is returned.
Required Methods§
Sourcefn div_exact_assign(&mut self, d: Rhs, pre: &Precompute) -> bool
fn div_exact_assign(&mut self, d: Rhs, pre: &Precompute) -> bool
Check if d divides self with the help of the precomputation. If d divides self, self is replaced by the quotient and true is returned.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".