As we have rem_wide, I'd like to request wrapping_div_wide with a type signature:
fn wrapping_div_wide<const HI_LIMBS: usize, const RHS_LIMBS: usize>((lo, hi): (Self, Uint<HI_LIMBS>), rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self;
(or approximate)
For my specific use case, I know the division to be exact, hence why I'd be fine with a wrapping_div_wide_exact method instead of a wrapping_div_wide method. I did poke at adding this myself but it appeared non-trivial. Modifying div_exact to also intake a x_hi: &mut UintRef, indexing x_lo when xi < x_lo.nlimbs() and x_hi otherwise was fine, but it still poked a bit too much for me to be comfortable without first making an issue to discuss this.
My practical use-case is I have such a need within my code and currently do lo.concat(hi).div_exact(rhs), but this requires the types implement Concat. As my segments are ~5k bits, the only types which reliably implement Concat are U6144, U8192, at which point I'm way over the size I'd like to be operating with. Removing the Concat bound would dramatically increase which types are eligible for use within my constraints.
This is horribly niche and I would not be offended at all if this was immediately closed as out-of-current-scope-availability/unreasonable.
As we have
rem_wide, I'd like to requestwrapping_div_widewith a type signature:(or approximate)
For my specific use case, I know the division to be exact, hence why I'd be fine with a
wrapping_div_wide_exactmethod instead of awrapping_div_widemethod. I did poke at adding this myself but it appeared non-trivial. Modifyingdiv_exactto also intake ax_hi: &mut UintRef, indexingx_lowhenxi < x_lo.nlimbs()andx_hiotherwise was fine, but it still poked a bit too much for me to be comfortable without first making an issue to discuss this.My practical use-case is I have such a need within my code and currently do
lo.concat(hi).div_exact(rhs), but this requires the types implementConcat. As my segments are ~5k bits, the only types which reliably implementConcatareU6144, U8192, at which point I'm way over the size I'd like to be operating with. Removing theConcatbound would dramatically increase which types are eligible for use within my constraints.This is horribly niche and I would not be offended at all if this was immediately closed as out-of-current-scope-availability/unreasonable.