sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.32k stars 451 forks source link

Remainder operator for integer symbols #21975

Open pelegm opened 7 years ago

pelegm commented 7 years ago

The following should probably work:

sage: x = SR.symbol('x', domain='integer')
sage: y = SR.symbol('y', domain='integer')
sage: x % y

but instead it raises the following error:

TypeError: unsupported operand parent(s) for '%': 'Symbolic Ring' and 'Symbolic Ring'

This is the behaviour in SymPy:

In [9]: x%y
Out[9]: Mod(x, y)

Component: symbolics

Keywords: remainder, modulo

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

rwst commented 7 years ago
comment:1

There is consensus on sage-devel that operations combining variables and elements of Zmod should not be supported by the symbolic ring (which mainly deals with calculus). While this is not such an operation per se, the expression will certainly be used later in operations. I'm not dismissing the ticket, just saying don't hold your breath.