Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency between documentation and code implementation #349

Open
YichiZhang0613 opened this issue Feb 21, 2024 · 1 comment
Open

Inconsistency between documentation and code implementation #349

YichiZhang0613 opened this issue Feb 21, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation to do To be done

Comments

@YichiZhang0613
Copy link
Contributor

YichiZhang0613 commented Feb 21, 2024

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);
@prestwich prestwich added the documentation Improvements or additions to documentation label Feb 27, 2024
@prestwich
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation to do To be done
Projects
None yet
Development

No branches or pull requests

2 participants