On Jun 20, 6:50 pm, Matthias Meulien <oron...@gmail.com> wrote:
> Hi,
>
> I can't figure out why the following commands ends with a TypeError
> exception.
>
> sage: basering = PolynomialRing(SR, 'x')
> sage: polynomial = basering.lagrange_polynomial([(0,0), (1,pi), (2, pi/
> 2)])
> sage:
> polynomial.base_ring()
> Symbolic Ring
> sage:
> type(polynomial)
> <class
> 'sage.rings.polynomial.polynomial_element_generic.Polynomial_generic_dense_field'>
> sage:
> polynomial.roots(x)
~ snip ~
> TypeError: base_ring must be a ring
>
> Thanks for reading.

sage: polynomial.roots?

gives lots of information including the calling information:
polynomial.roots(self, ring=None, multiplicities=True, algorithm
=None)

It appears that a ring is needed. If I do
sage: polynomial.roots(RR)
[(0.000000000000000, 1), (2.33333333333333, 1)]

There may be more information in the doc string that is useful for
you.
HTH,
Adam

-- 
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