Skip to main content

div3by2

Function div3by2 

Source
pub(crate) const fn div3by2(
    (u0, u1, u2): (Word, Word, Word),
    (d0, d1): (Word, Word),
    v: Word,
) -> (Word, WideWord)
Expand description

Given two long integers u = (..., u0, u1, u2) and v = (..., v0, v1) (where u2 and v1 are the most significant limbs), where floor(u / v) <= Limb::MAX, calculates q such that q - 1 <= floor(u / v) <= q. In place of v1 takes its reciprocal, and assumes that v was already pre-shifted so that v1 has its most significant bit set (that is, the reciprocal’s shift is 0).