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

change the mod method of rationals #21748

Open
videlec opened this issue Oct 23, 2016 · 2 comments
Open

change the mod method of rationals #21748

videlec opened this issue Oct 23, 2016 · 2 comments

Comments

@videlec
Copy link
Contributor

videlec commented Oct 23, 2016

The current behavior of mod on Sage rationals is currently useless

sage: (2/3).mod(5)
0
sage: (2/3).mod(6)
0

And very different from what mod_ui does

sage: (2/3).mod_ui(5)
4
sage: (2/3).mod_ui(6)
Traceback (most recent call last):
...
ArithmeticError: The inverse of 3 modulo 6 is not defined.

This ticket stands for:

  • changing the behavior of mod on rationals to be consistent to the current mod_ui (and handle the potential overflow in mod_ui)
  • deprecate mod_ui in favor of mod

This change will make Sage compatible with PARI/GP Mod and maple mod.

Component: basic arithmetic

Issue created by migration from https://trac.sagemath.org/ticket/21748

@videlec videlec added this to the sage-7.5 milestone Oct 23, 2016
@videlec

This comment has been minimized.

@videlec

This comment has been minimized.

@mkoeppe mkoeppe removed this from the sage-7.5 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants