`algorithms/mul`: carry` and `borrow` can probably be merged into a single var.
- Ngôn ngữ chính
- Rust
- Star
- 225
- Fork
- 70
- Merge trung bình
- 16 giờ 54 phút
- Pull request đã merge (30 ngày)
- 8
Mô tả
*On 2022-10-24 @recmo wrote in [`fb3aa20`](https://github.com/recmo/uint/commit/fb3aa200dea389e2d1b0a23981da48a77a08b738) “Merge pull request #172 from recmo/div2”:*
carry` and `borrow` can probably be merged into a single var.
```rust
/// \begin{aligned}
/// \mathsf{lhs'} &= \mod{\mathsf{lhs} - \mathsf{a} ⋅ \mathsf{b}}_{2^{64⋅N}}
/// \\\\ \mathsf{borrow} &= \floor{\frac{\mathsf{a} ⋅ \mathsf{b} -
/// \mathsf{lhs}}{2^{64⋅N}}} \end{aligned}
/// $$
// OPT: `carry` and `borrow` can probably be merged into a single var.
#[inline(always)]
pub fn submul_nx1(lhs: &mut [u64], a: &[u64], b: u64) -> u64 {
debug_assert_eq!(lhs.len(), a.len());
let mut carry = 0;
let mut borrow = 0;
```
*From [`src/algorithms/mul.rs:81`](https://github.com/recmo/uint/blob/fb3aa200dea389e2d1b0a23981da48a77a08b738/src/algorithms/mul.rs#L81)*
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.