Ticket #3617 (closed defect: fixed)
LarentPolynomial.__call__ is broken for Laurent polynomial's that have negative exponents
| Reported by: | mhansen | Owned by: | malb |
|---|---|---|---|
| Priority: | major | Milestone: | sage-4.3.2 |
| Component: | commutative algebra | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | N/A | Reviewers: | Sebastian Pancratz |
| Authors: | Mike Hansen | Merged in: | sage-4.3.2.alpha0 |
| Dependencies: | Stopgaps: |
Description
sage: P.<q> = LaurentPolynomialRing(QQ)
sage: qi = q^(-1)
sage: qi in P
False
sage: q in P
True
sage: P(qi)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/mike/<ipython console> in <module>()
/opt/sage/local/lib/python2.5/site-packages/sage/rings/polynomial/laurent_polynomial_ring.py in __call__(self, x)
679 sage: L(1/2)
680 1/2
681 """
--> 682 return LaurentPolynomial_mpair(self, x)
683
/home/mike/laurent_polynomial.pyx in sage.rings.polynomial.laurent_polynomial.LaurentPolynomial_mpair.__init__ (sage/rings/polynomial/laurent_polynomial.c:1889)()
/home/mike/multi_polynomial_libsingular.pyx in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular.__call__ (sage/rings/polynomial/multi_polynomial_libsingular.cpp:5984)()
/opt/sage/local/lib/python2.5/site-packages/sage/rings/rational_field.py in __call__(self, x, base)
216 return x
217
--> 218 return sage.rings.rational.Rational(x, base)
219
220 def construction(self):
/home/mike/rational.pyx in sage.rings.rational.Rational.__init__ (sage/rings/rational.c:3321)()
/home/mike/rational.pyx in sage.rings.rational.Rational.__set_value (sage/rings/rational.c:4494)()
TypeError: Unable to coerce q^-1 (<type 'sage.rings.polynomial.laurent_polynomial.LaurentPolynomial_mpair'>) to Rational
Attachments
Change History
comment:1 Changed 3 years ago by mhansen
- Status changed from new to needs_review
- Report Upstream set to N/A
- Authors set to Mike Hansen
Note: See
TracTickets for help on using
tickets.

