Opened 5 years ago

Last modified 5 years ago

#21748 new enhancement

change the mod method of rationals

Reported by: vdelecroix Owned by:
Priority: major Milestone: sage-7.5
Component: basic arithmetic Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by vdelecroix)

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.

Change History (2)

comment:1 Changed 5 years ago by vdelecroix

  • Description modified (diff)

comment:2 Changed 5 years ago by vdelecroix

  • Description modified (diff)
Note: See TracTickets for help on using tickets.