#9595: Conversion from constant PARI polynomials to QQ doesn't work
------------------------------+---------------------------------------------
Reporter: jdemeyer | Owner: robertwb
Type: defect | Status: new
Priority: major | Milestone: sage-4.5.2
Component: coercion | Keywords:
Author: Jeroen Demeyer | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------------+---------------------------------------------
We create a constant PARI polynomial with value 1/2 and coerce it to QQ:
{{{
sage: constpol = pari('Pol([1/2])')
sage: QQ(constpol)
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/usr/local/src/sage-4.5.2.alpha0/<ipython console> in <module>()
/usr/local/src/sage-4.5.2.alpha0/local/lib/python2.6/site-
packages/sage/structure/parent.so in sage.structure.parent.Parent.__call__
(sage/structure/parent.c:6407)()
/usr/local/src/sage-4.5.2.alpha0/local/lib/python2.6/site-
packages/sage/structure/coerce_maps.so in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3108)()
/usr/local/src/sage-4.5.2.alpha0/local/lib/python2.6/site-
packages/sage/structure/coerce_maps.so in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3010)()
/usr/local/src/sage-4.5.2.alpha0/local/lib/python2.6/site-
packages/sage/rings/rational.so in sage.rings.rational.Rational.__init__
(sage/rings/rational.c:5781)()
/usr/local/src/sage-4.5.2.alpha0/local/lib/python2.6/site-
packages/sage/rings/rational.so in
sage.rings.rational.Rational.__set_value (sage/rings/rational.c:6853)()
/usr/local/src/sage-4.5.2.alpha0/local/lib/python2.6/site-
packages/sage/rings/integer.so in sage.rings.integer.Integer.__init__
(sage/rings/integer.c:6285)()
TypeError: Unable to coerce PARI 1/2 to an Integer.
}}}
Note how the error message indicated conversion to Integer somehow.
Indeed, {{{QQ(pari('Pol([1])'))}}} works
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9595>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.