alloy-rs / alloy-rs/ruint

`algorithms/gcd/matrix`: Fix the below method to get double-word Lehmer GCD.

未关闭
#121 0 条评论 0 个 reaction 已指派 1 人 已被 @recmo 认领 在 GitHub 查看
optimize tracker
主要语言
Rust
星标
225
派生
70
平均合并
16 小时 54 分钟
30 天内合并 PR
8

描述

*On 2022-06-06 @recmo wrote in [`4c74c09`](https://github.com/recmo/uint/commit/4c74c09b4d6f425cda931e9f5e8d00f1367c4261) “Merge pull request #110 from recmo/gcd”:*

Fix the below method to get double-word Lehmer GCD.

```rust
if q == Matrix::IDENTITY {
return q;
}
// We can return q here and have a perfectly valid single-word Lehmer GCD.
q
// OPT: Fix the below method to get double-word Lehmer GCD.

// Recompute r0 and r1 and take the high bits.
// TODO: Is it safe to do this based on just the u128 prefix?
// let (r0, r1) = q.apply_u128(r0, r1);
// let s = r0.leading_zeros();

```
*From [`src/algorithms/gcd/matrix.rs:312`](https://github.com/recmo/uint/blob/4c74c09b4d6f425cda931e9f5e8d00f1367c4261/src/algorithms/gcd/matrix.rs#L312)*

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。