Opened 11 years ago
Closed 6 years ago
#3865 closed defect (fixed)
Bug in conversion from gp elements to p-adics
Reported by: | craigcitro | Owned by: | craigcitro |
---|---|---|---|
Priority: | major | Milestone: | sage-5.12 |
Component: | interfaces | Keywords: | sd51 |
Cc: | Merged in: | sage-5.12.beta2 | |
Authors: | David Loeffler | Reviewers: | Jan Tuitman |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
David Loeffler ran into the following:
sage: v = gp.polrootspadic(x^2-2, 7, 20)[1] sage: R = Zp(7, 10, "capped-rel") sage: R(v) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /Users/craigcitro/<ipython console> in <module>() /Users/craigcitro/three-one/local/lib/python2.5/site-packages/sage/rings/padics/padic_generic.py in __call__(self, x, absprec, relprec) 82 Casts x into self. Uses the constructor of self._element_class. 83 """ ---> 84 return self._element_class(self, x, absprec, relprec) 85 86 def _coerce_impl(self, x): /Users/craigcitro/padic_capped_relative_element.pyx in sage.rings.padics.padic_capped_relative_element.pAdicCappedRelativeElement.__init__ (sage/rings/padics/padic_capped_relative_element.c:4872)() /Users/craigcitro/rational.pyx in sage.rings.rational.Rational.__init__ (sage/rings/rational.c:3767)() /Users/craigcitro/rational.pyx in sage.rings.rational.Rational.__set_value (sage/rings/rational.c:4567)() /Users/craigcitro/three-one/local/lib/python2.5/site-packages/sage/interfaces/expect.py in _rational_(self) 1393 def _rational_(self): 1394 import sage.rings.all -> 1395 return sage.rings.all.Rational(repr(self)) 1396 1397 def name(self, new_name=None): /Users/craigcitro/rational.pyx in sage.rings.rational.Rational.__init__ (sage/rings/rational.c:3767)() /Users/craigcitro/rational.pyx in sage.rings.rational.Rational.__set_value (sage/rings/rational.c:4533)() TypeError: unable to convert 3 + 7 + 2*7^2 + 6*7^3 + 7^4 + 2*7^5 + 7^6 + 2*7^7 + 4*7^8 + 6*7^9 + 6*7^10 + 2*7^11 + 7^12 + 7^13 + 2*7^15 + 7^16 + 7^17 + 4*7^18 + 6*7^19 + O(7^20) to a rational
The trouble is that the code in the __init__
method for pAdicCappedRelativeElement
s only looks for Pari gen
objects, not GpElement
s. The fix should be trivial, but I'm going to look at it tomorrow.
Attachments (1)
Change History (8)
comment:1 Changed 11 years ago by
comment:2 Changed 6 years ago by
- Description modified (diff)
- Report Upstream set to N/A
- Status changed from new to needs_review
... tock. :-)
comment:3 Changed 6 years ago by
- Keywords sd51 added
comment:4 Changed 6 years ago by
- Status changed from needs_review to positive_review
looks good and works!
comment:5 Changed 6 years ago by
- Reviewers set to Jan Tuitman
comment:6 Changed 6 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:7 Changed 6 years ago by
- Merged in set to sage-5.12.beta2
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Tick Tick :p
Cheers,
Michael