Skip to content

Commit ecb1c4a

Browse files
committed
1 parent f080a10 commit ecb1c4a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ numbers to decimal strings.
1111
This Rust implementation is a line-by-line port of Victor Zverovich's
1212
implementation in C++, [https://github.com/vitaut/zmij][upstream].
1313

14-
[upstream]: https://github.com/vitaut/zmij/tree/154bf6635a7f03e022cfd445afdb95b719f70d48
14+
[upstream]: https://github.com/vitaut/zmij/tree/9a433c4bed034447c051e16b405ebc43cae05957
1515

1616
## Example
1717

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ const fn umul128(x: u64, y: u64) -> u128 {
9696
x as u128 * y as u128
9797
}
9898

99+
const fn umul128_upper64(x: u64, y: u64) -> u64 {
100+
(umul128(x, y) >> 64) as u64
101+
}
102+
99103
#[cfg_attr(feature = "no-panic", no_panic)]
100104
fn umul192_upper128(x_hi: u64, x_lo: u64, y: u64) -> uint128 {
101105
let p = umul128(x_hi, y);
@@ -106,10 +110,6 @@ fn umul192_upper128(x_hi: u64, x_lo: u64, y: u64) -> uint128 {
106110
}
107111
}
108112

109-
const fn umul128_upper64(x: u64, y: u64) -> u64 {
110-
(umul128(x, y) >> 64) as u64
111-
}
112-
113113
// Computes upper 64 bits of multiplication of x and y, discards the least
114114
// significant bit and rounds to odd, where x = uint128_t(x_hi << 64) | x_lo.
115115
#[cfg_attr(feature = "no-panic", no_panic)]

0 commit comments

Comments
 (0)