Comment #11 on issue 604 by asmeurer: write tests for p = x**3+2*x**2+8; r  
= roots(p, x);
http://code.google.com/p/sympy/issues/detail?id=604

roots() returns a dictionary (notice type(r)) of root:multiplicity terms.   
For example:

In [5]: p = (x - 12)*(x - 13)**2*(x - 42)**2

In [6]: roots(p, x)
Out[6]: {12: 1, 13: 2, 42: 2}

You can use r.keys() to get a list of the keys, so you would want to do:

In [11]: r.keys()[0].evalf()
Out[11]: 0.465571231876768 + 1.5851039850309⋅ⅈ


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--

You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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/sympy-issues?hl=en.


Reply via email to