Comment #2 on issue 3223 by smi...@gmail.com: degree((x+1)**10000) takes too long
http://code.google.com/p/sympy/issues/detail?id=3223
But watch out if it's not a "polynomial":
-(exp(x)).subs(x, 1/x).leadterm(x)[0]
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "sympy\core\expr.py", line 2536, in leadterm should have been free of x but got %s""" % (self, x, c))) ValueError: cannot compute leadterm(exp(1/x), x). The coefficient should have been free of x but got exp(1/x)
exp(x).subs(x, 1/x).as_leading_term(x).subs(x, 1/x)
exp(x)
((exp(x)+x/2)**10).subs(x, 1/x).as_leading_term(x).subs(x, 1/x)
exp(10*x)
_.as_coeff_exponent(x)
(exp(10*x), 0)
((x**2+x/2)**10).subs(x, 1/x).as_leading_term(x).subs(x, 1/x)
x**20
_.as_coeff_exponent(x)
(1, 20) -- You received this message because you are subscribed to the Google Groups "sympy-issues" group. To post to this group, send email to sympy-issues@googlegroups.com. To unsubscribe from this group, send email to sympy-issues+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy-issues?hl=en.