-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
make divmod() work for more rings #33704
Labels
Milestone
Comments
This comment has been minimized.
This comment has been minimized.
Commit: |
New commits:
|
yyyyx4
changed the title
support divmod() in addition to .quo_rem()
make divmod() work for more rings
Apr 24, 2022
Reviewer: Travis Scrimshaw |
comment:3
Author name. |
comment:4
Oops! |
Author: Lorenz Panny |
comment:5
Bot seems green enough. Thanks! |
Changed branch from public/move_divmod_up_to_RingElement to |
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python's
divmod()
is only supported forEuclideanDomainElement
s in Sage, whereas.quo_rem()
is more universal.It is worth noting that
.quo_rem()
,//
,%
despite not being Euclidean domains (example:ZZ['x']
); andEuclideanDomainElement
(example:QQ['x']
).Therefore,
divmod()
will often not work when it should.This patch moves
.__divmod__()
up fromEuclideanDomainElement
toRingElement
, which makesdivmod()
work for more rings. Of course, not all rings have division with remainder implemented, but we can simply let that fail in the callee.Short mailing list discussion: https://groups.google.com/g/sage-devel/c/GlTlFkQCQ0M
CC: @roed314 @kcrisman
Component: algebra
Author: Lorenz Panny
Branch/Commit:
778bef3
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/33704
The text was updated successfully, but these errors were encountered: