-
-
Notifications
You must be signed in to change notification settings - Fork 548
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
Failure with Python int modulo a rational #14870
Comments
Author: Travis Scrimshaw |
comment:1
Fixed. Thanks Volker and David for your insight. |
comment:3
You shouldn't check the type exactly, derived classes of rational should be treated like a rational. Also, the whole |
comment:4
We tried using decimals like 3.0, coerced rationals like QQ(3), non-reduced fractions like 4/2, complex-like values like 3+0*I, and absolute values of integers as moduli (second argument in function)--all of these were correctly interpreted as integers. We also found correct error messages for moduli that didn't make sense, for example mod(31/10, 10) produces a correct error message. Looks good! |
Attachment: trac_14870-fix_int_mod_QQ-ts.patch.gz |
comment:5
New version as per Volker's comment. |
comment:6
@sagetrac-malmskog, you'll need to write your real name as the reviewer. |
Reviewer: Beth Malmskog |
Merged: sage-5.12.beta0 |
Some fun I came across:
Note that this works:
CC: @vbraun @roed314
Component: basic arithmetic
Author: Travis Scrimshaw
Reviewer: Beth Malmskog
Merged: sage-5.12.beta0
Issue created by migration from https://trac.sagemath.org/ticket/14870
The text was updated successfully, but these errors were encountered: