num_bigint_dig::algorithms

Function div_wide

Source
pub fn div_wide(hi: u32, lo: u32, divisor: u32) -> (u32, u32)
Expand description

Divide a two digit numerator by a one digit divisor, returns quotient and remainder:

Note: the caller must ensure that both the quotient and remainder will fit into a single digit. This is not true for an arbitrary numerator/denominator.

(This function also matches what the x86 divide instruction does).