uint icon indicating copy to clipboard operation
uint copied to clipboard

`algorithms/div/reciprocal`: This is checking the carry flag

Open github-actions[bot] opened this issue 2 years ago • 0 comments

On 2022-10-24 @recmo wrote in fb3aa20 “Merge pull request #172 from recmo/div2”:

This is checking the carry flag

    let d1 = (d >> 64) as u64;
    let d0 = d as u64;

    let mut v = reciprocal(d1);
    let mut p = d1.wrapping_mul(v).wrapping_add(d0);
    // OPT: This is checking the carry flag
    if p < d0 {
        v = v.wrapping_sub(1);
        if p >= d1 {
            v = v.wrapping_sub(1);
            p = p.wrapping_sub(d1);

From src/algorithms/div/reciprocal.rs:113

github-actions[bot] avatar Oct 24 '22 06:10 github-actions[bot]