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

Nitpick: Sage performs euclidean division with integer remainders as opposed to non-negative integers #114

Open
dcbuild3r opened this issue Aug 20, 2024 · 0 comments

Comments

@dcbuild3r
Copy link

When implementing the euclidean division algorithm as part of Exercise 3.2.6 I noticed that Sage doesn't define the remainder $r$ as a non-negative integer like in the book. It produces negative integers for certain inputs which caused some confusion when testing my implementation against Sage.

In this example the output will be $(3, -1)$ as opposed to $(4, 2)$ which satisfies the constraint of $r$ being a non-negative integer:

sage: ZZ(-10).quo_rem(ZZ(-3))
(3, -1)
@dcbuild3r dcbuild3r changed the title Nitpick: Sage performs euclidean division with integer remainders as opposed to a non-negative integer Nitpick: Sage performs euclidean division with integer remainders as opposed to non-negative integers Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant