That worked.

On Oct 23, 7:41 pm, John H Palmieri <jhpalmier...@gmail.com> wrote:
> On Oct 23, 7:20 pm, Cary Cherng <cche...@gmail.com> wrote:
>
> > R.<g17,g19,g27,g28,g38,g39,g47,g49,g57,g58,g68,g69> =
> > PolynomialRing(QQ)
>
> > Eventually I compute a polynomial p with something like
>
> > p = p1 / q.determinant()
>
> > Sage gives p with type fraction field. How do I cast p back to the
> > polynomial ring so I can call degree() on it?
>
> Does R(p) give what you want?
>
> sage: R.<g17,g19> = PolynomialRing(QQ)
> sage: R.inject_variables()
> Defining g17, g19
> sage: p = (g17^2 - g19^2)/(g17 + g19)
> sage: type(p)
> <type 'sage.rings.fraction_field_element.FractionFieldElement'>
> sage: type(R(p))
> <type
> 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular '>
>
> --
> John

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to