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
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)
The text was updated successfully, but these errors were encountered:
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
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:
The text was updated successfully, but these errors were encountered: