#7741: Can't construct a rational fraction from a symbolic one.
------------------------+---------------------------------------------------
Reporter: hivert | Owner: robertwb
Type: defect | Status: new
Priority: major | Milestone:
Component: coercion | Keywords: Fraction Field, coercion
Work_issues: | Author:
Upstream: N/A | Reviewer:
Merged: |
------------------------+---------------------------------------------------
Given a symbolic expression which is a rational fraction sage refuse to
convert it to a element of the Field of rational fraction:
{{{
hiv...@boxen:~$ sage
----------------------------------------------------------------------
| Sage Version 4.2.1, Release Date: 2009-11-14 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: fr = (1+x)/(1+x+x^2)
sage: Fld = FractionField(PolynomialRing(QQ,x))
sage: Fld(fr)
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (1181, 0))
[...]
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
[...]
/usr/local/sage/local/lib/python2.6/site-
packages/sage/rings/polynomial/polynomial_ring.pyc in
_element_constructor_(self, x, check, is_gen, construct, **kwds)
304 x = x.numerator() *
x.denominator().inverse_of_unit()
305 else:
--> 306 raise TypeError, "denominator must be a unit"
307
308 elif isinstance(x, pari_gen):
TypeError: denominator must be a unit
}}}
It seems that it needs to convert is to a polynomial. Of course if one
convert numerator and denominator separately everything is Ok:
{{{
sage: Fld((1+x))/(1+x+x^2)
(x + 1)/(x^2 + x + 1)
}}}
I'm not sure about which component should be selected... Is it algebra,
calculus or coercion...
Florent
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7741>
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.