Skip to content

Commit 329e58b

Browse files
committed
rename as widening_mul
1 parent fb029b4 commit 329e58b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

text/0000-carrying-mul.md renamed to text/0000-widening-mul.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- Feature Name: carrying_mul
1+
- Feature Name: widening_mul
22
- Start Date: 2018-04-24
33
- RFC PR:
44
- Rust Issue:
@@ -20,14 +20,14 @@ As the author writes, the "num-bigint" crate merely uses `u32` as its word type
2020
# Guide-level explanation
2121
[guide-level-explanation]: #guide-level-explanation
2222

23-
In general, the product of an m-bit and an n-bit number has (m+n) bits. If one wishes to define arbitrary-precision arithmetic, one (usually) chooses a word size, and defines the multiple-precision operations in terms of primitive operations on this type. The `carrying_mul` function allows one to do so conveniently, for example:
23+
In general, the product of an m-bit and an n-bit number has (m+n) bits. If one wishes to define arbitrary-precision arithmetic, one (usually) chooses a word size, and defines the multiple-precision operations in terms of primitive operations on this type. The `widening_mul` function allows one to do so conveniently, for example:
2424

2525
```rust
2626
pub struct u2size { msw: usize, lsw: usize }
2727

2828
impl Mul for u2size {
2929
fn mul(self, other: Self) -> Self {
30-
let (lsw, c) = self.lsw.carrying_mul(other.lsw);
30+
let (lsw, c) = self.lsw.widening_mul(other.lsw);
3131
u2size { lsw, msw: c + self.msw * other.lsw
3232
+ self.lsw * other.msw }
3333
}
@@ -37,7 +37,7 @@ impl Mul for u2size {
3737
# Reference-level explanation
3838
[reference-level-explanation]: #reference-level-explanation
3939

40-
`pub fn carrying_mul(self, other: Self) -> (Self, Self)`
40+
`pub fn widening_mul(self, other: Self) -> (Self, Self)`
4141

4242
Returns the low and high words of the product of `self` and `other`.
4343

0 commit comments

Comments
 (0)