# Ticket #11719: trac_11719.patch

File trac_11719.patch, 3.6 KB (added by boothby, 11 years ago)
• ## sage/rings/laurent_series_ring_element.pyx

```# HG changeset patch
# Parent c3ed00686ffbbfdde9b6a1ef50991017a1b0bd75

diff -r c3ed00686ffb sage/rings/laurent_series_ring_element.pyx```
 a 1 """ return self.__u.is_zero() def is_monomial(self): """ Returns True if this element is a monomial.  That is, if self is `a*x^n` for some non-negative integer `n` and some coefficient `a` in the base ring. EXAMPLES:: sage: k. = LaurentSeriesRing(QQ, 'z') sage: (30*z).is_monomial() True sage: k(1).is_monomial() True sage: (z+1).is_monomial() False sage: (3*z^-2909).is_monomial() True """ return self.__u.is_monomial() def __nonzero__(self): return not not self.__u
• ## sage/rings/polynomial/laurent_polynomial.pyx

`diff -r c3ed00686ffb sage/rings/polynomial/laurent_polynomial.pyx`
 a cpdef ModuleElement _ilmul_(self, RingElement c): self.__u *= c return self def is_monomial(self): """ Returns True if this element is a monomial.  That is, if self is `a*x^n` for some integer `n` and some coefficient `a` in the base ring. EXAMPLES:: sage: k. = LaurentPolynomialRing(QQ) sage: z.is_monomial() True sage: k(1).is_monomial() True sage: (z+1).is_monomial() False sage: (38*z^-2909).is_monomial() True """ return self.__u.is_monomial() def __pow__(_self, r, dummy): """ ans._poly -= right._poly return ans def is_monomial(self): """ Returns True if this element is a monomial. EXAMPLES:: sage: k. = LaurentPolynomialRing(QQ) sage: z.is_monomial() True sage: k(1).is_monomial() True sage: (z+1).is_monomial() False sage: (38*z^-2909).is_monomial() True """ return len(self._poly.dict()) <= 1 cpdef ModuleElement _neg_(self): """ Returns -self.
• ## sage/rings/power_series_ring_element.pyx

`diff -r c3ed00686ffb sage/rings/power_series_ring_element.pyx`
 a def __rshift__(self, n): return self.parent()(self.polynomial() >> n, self.prec()) def is_monomial(self): """ Returns True if this element is a monomial.  That is, if self is `a*x^n` for some non-negative integer `n` and some coefficient `a` in the base ring. EXAMPLES:: sage: k. = PowerSeriesRing(QQ, 'z') sage: z.is_monomial() True sage: k(1).is_monomial() True sage: (z+1).is_monomial() False sage: (z^2909).is_monomial() True """ return self.polynomial().is_monomial() def is_square(self): """ Returns True if this function has a square root in this ring, e.g.