Opened 6 years ago

Closed 6 years ago

#17417 closed enhancement (duplicate)

symbolic modulo

Reported by: rws Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: symbolics Keywords: mod, function
Cc: Merged in:
Authors: Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

There is currently no way to specify and simplify symbolic expressions modulo another symbolic expression. While Mod takes only numerics, the automatic simplification done by ex.mod() is not right because the expected result would be either x (for x integer) or -3*floor(x^3/3)+x^3 (else).

sage: assume(x, "integer")
sage: (x^3).mod(3)
x^3
sage: (x^3).mod(3,hold=True)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-38-d8e5ba2bdd31> in <module>()
----> 1 (x**Integer(3)).mod(Integer(3),hold=True)

TypeError: mod() takes no keyword arguments

There may be Maxima functions for this but, if so, they aren't used by Sage.

Brought up in http://ask.sagemath.org/question/25037/declaring-variable-to-be-in-a-particular-fieldringgroup/

Change History (3)

comment:1 Changed 6 years ago by jdemeyer

  • Milestone changed from sage-6.5 to sage-duplicate/invalid/wontfix
  • Reviewers set to Jeroen Demeyer
  • Status changed from new to needs_review

Duplicate of #9935.

comment:2 Changed 6 years ago by jdemeyer

  • Status changed from needs_review to positive_review

comment:3 Changed 6 years ago by vbraun

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.