(lhs: u64, rhs: u64)
| 286 | #[inline] |
| 287 | #[must_use] |
| 288 | pub const fn overflowing_add_u64(lhs: u64, rhs: u64) -> (u64, Choice) { |
| 289 | let sum = lhs.wrapping_add(rhs); |
| 290 | let carry = ((lhs & rhs) | ((lhs | rhs) & !sum)) >> (u64::BITS - 1); |
| 291 | (sum, Choice::from_u64_lsb(carry)) |
| 292 | } |
| 293 | |
| 294 | /// Add two integers, returning the wrapping sum and [`Choice::TRUE`] on overflow. |
| 295 | #[inline] |
no test coverage detected