You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In uint-main/src/bits.rs, the code will panic if index == byte width(in the example is 8), while the comment indicates that code will panic if index > byte width, so I think maybe >= should replace "exceeds".
/// # Panics////// Panics if `index` exceeds the byte width of the number./// ```should_panic/// # use ruint::uint;/// let x = uint!(0x1234567890_U64);/// let _ = x.byte(8);pubconstfnbyte(&self,index:usize) -> u8{#[cfg(target_endian = "little")]{self.as_le_slice()[index]}#[cfg(target_endian = "big")]#[allow(clippy::cast_possible_truncation)]// intentional{(self.limbs[index / 8] >> ((index % 8)*8))asu8}}
In uint-main/src/algorithms/div/knuth.rs, the comment indicates that panic if divisor.len()< 2 and numerator.len() < 2, while the code panics if divisor.len()< 3 and numerator.len() < 3
/// Requires/// * the highest limb of the divisor to be non-zero,/// * the `divisor` and `numerator` to be at least two limbs, and/// * `numerator` is at least as long as `divisor`.////// # Panics////// May panic if the above requirements are not met.#[inline]#[allow(clippy::many_single_char_names)]pubfn div_nxm(numerator:&mut[u64],divisor:&mut[u64]){debug_assert!(divisor.len() >= 3);debug_assert!(numerator.len() >= divisor.len());debug_assert!(*divisor.last().unwrap() >= 1);
The text was updated successfully, but these errors were encountered:
In uint-main/src/bits.rs, the code will panic if index == byte width(in the example is 8), while the comment indicates that code will panic if index > byte width, so I think maybe >= should replace "exceeds".
In uint-main/src/algorithms/div/knuth.rs, the comment indicates that panic if divisor.len()< 2 and numerator.len() < 2, while the code panics if divisor.len()< 3 and numerator.len() < 3
The text was updated successfully, but these errors were encountered: