uint
uint copied to clipboard
`algorithms/gcd/gcd_old`: Can we reuse the shifted variables here?
On 2022-06-06 @recmo wrote in 4c74c09
“Merge pull request #110 from recmo/gcd”:
Can we reuse the shifted variables here?
// We can return q here and have a perfectly valid single-word Lehmer GCD.
// return q;
// Recompute r0 and r1 and take the high bits.
// OPT: This does not need full precision.
// OPT: Can we reuse the shifted variables here?
lehmer_update(&mut r0, &mut r1, &q);
let s = r0.leading_zeros();
let r0s = r0 << s;
let r1s = r1 << s;
let qn = lehmer_loop(r0s.limb(3), r1s.limb(3));