pub fn div_rem(&self, rhs: &Self) -> (Self, Self) {
        debug_assert!(
            *rhs != UnsignedInteger::from_u64(0),
            "Attempted to divide by zero"
        );
        let mb = rhs.bits_le();
        let mut bd = (NUM_LIMBS * u64::BITS as usize) - mb;
        let mut rem = *self;
        let mut quo = Self::from_u64(0);
        let mut c = rhs.shl(bd);

        loop {
            let (mut r, borrow) = rem.sbb(&c, 0);
            debug_assert!(borrow == 0 || borrow == u64::MAX);
            rem = Self::ct_select(&r, &rem, borrow);
            r = quo.bitor(Self::from_u64(1));
            quo = Self::ct_select(&r, &quo, borrow);
            if bd == 0 {
                break;
            }
            bd -= 1;
            c = c.shr(1);
            quo = quo.shl(1);
        }

        let is_some = Self::ct_is_nonzero(mb as u64);
        quo = Self::ct_select(&Self::from_u64(0), &quo, is_some);
        (quo, rem)
    }
Computes self / rhs, returns the quotient, remainder.
crates/math/src/unsigned_integer/element.rs