uint
uint copied to clipboard
Inconsistency between documentation and code implementation
I noticed a possible inconsistency between documentation and code implementation in uint/src/algorithms/gcd/matrix.rs. The details can be found in the following code. The document require checking r1 >= r0, but the actual check is r0 >= r1
/// # Panics
///
/// Panics if `r1 < r0`.
// OPT: Would this be faster using extended binary gcd?
// See <https://en.algorithmica.org/hpc/algorithms/gcd>
#[inline]
#[must_use]
pub fn from_u64(mut r0: u64, mut r1: u64) -> Self {
debug_assert!(r0 >= r1);
The code appears to be correct, and the documentation incorrect. Fixing the doc is low priority right now. May do it as a drive-by during other things