Status: Accepted
Owner: asmeurer
Labels: Type-Defect Priority-Medium

New issue 2558 by asmeurer: coeff() should allow x**0 (constant coefficients)
http://code.google.com/p/sympy/issues/detail?id=2558

The way that coeff() works, you cannot get the constant coefficient. Therefore, if you wanted to use it to get the coefficient of the terms of a polynomial, for example, you cannot, because you can't get the coefficient of 1 (something like (x + 1).coeff(1) gives x + 1, because both x and 1 and "coefficient" 1).

The solution that Maple and other systems use is to allow the syntax coeff(expr, x, n) as the equivalent of coeff(expr, x**n), except that when n is 0 it gets the constant term (with respect to x). So we should do the same, redefining coeff as coeff(expr, x, n=None) (or maybe n should default to 1).

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