Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Add _floordiv_
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorkarn committed Sep 15, 2022
1 parent 08202bc commit 1f3e285
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/sage/rings/polynomial/infinite_polynomial_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,21 @@ def __call__(self, *args, **kwargs):
except Exception:
return res

def _floordiv_(self, right):
"""
Implement a floor division by passing to the finite polynomial ring.
EXAMPLES::
sage: R.<z> = InfinitePolynomialRing(QQ)
sage: (z[10]+z[0]) // (z[10] + z[0])
1
sage: z[10] // (z[10] + z[0])
0
"""
R = self.parent()._P
return self.parent()(R(self)._floordiv_(R(right)))

def _getAttributeNames(self):
"""
This method implements tab completion, see :trac:`6854`.
Expand Down

0 comments on commit 1f3e285

Please sign in to comment.