Resolve precedence clippy lint
error: operator precedence can trip the unwary --> src/udiv128.rs:15:17 | 15 | let high2 = x_hi as u128 * y_lo as u128 + m_lo as u128 >> 64; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(x_hi as u128 * y_lo as u128 + m_lo as u128) >> 64` | = note: `-D clippy::precedence` implied by `-D clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
This commit is contained in:
parent
3091ce69da
commit
fb7a827f32
|
@ -12,7 +12,7 @@ fn u128_mulhi(x: u128, y: u128) -> u128 {
|
|||
let high1 = m >> 64;
|
||||
|
||||
let m_lo = m as u64;
|
||||
let high2 = x_hi as u128 * y_lo as u128 + m_lo as u128 >> 64;
|
||||
let high2 = (x_hi as u128 * y_lo as u128 + m_lo as u128) >> 64;
|
||||
|
||||
x_hi as u128 * y_hi as u128 + high1 + high2
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue