collect() bug

Alexander Frink Alexander.Frink at Uni-Mainz.DE
Mon Dec 20 17:15:35 CET 1999


On Mon, 20 Dec 1999, Christian Bauer wrote:
> > collect((1-t^2)/(1+t),t);
> (t+1)^(-1)
> 
> This is clearly wrong...

The problem is that degree() and ldegree() assume polynomials 
as input and do not check the result:

GiNaCcint> cout << degree((1-pow(ex(t),ex(2)))/(1+t),t) << endl;
1
GiNaCcint> cout << ldegree((1-pow(ex(t),ex(2)))/(1+t),t) << endl;
0

Maple returns FAIL for these expressions.

-- 
Alexander Frink                      E-Mail: Alexander.Frink at Uni-Mainz.DE
Institut fuer Physik                 Phone:  +49-6131-3923391
Johannes-Gutenberg-Universitaet
D-55099 Mainz, Germany




More information about the GiNaC-devel mailing list