]>
www.ginac.de Git - ginac.git/commit
Fix is_polynomial() so it works as advertised in the manual.
GiNaC manual says:
"Testing whether an expression is a polynomial in one or more variables
can be done with the method
bool ex::is_polynomial(const ex & vars) const;
In the case of more than one variable, the variables are given as a list.
(x*y*sin(y)).is_polynomial(x) // Returns true.
(x*y*sin(y)).is_polynomial(lst(x,y)) // Returns false."
However, the implementation is a bit inconsistent, as GiNaC reports
sin(x) + 2*s is a polynomial in s, but
pow(2,x) + 2*s is not a polynomial in s.
This patch fixes the inconsistency. Thanks to Jonathan Cross for reporting
this bug.