Hello, this symbol x("x"), a("a"); cout << (a*x/2+a*a/3).content(x) << endl; cout << (x/2+ex(1)/3).content(x) << endl; cout << (10*x/2+ex(15)/3).content(x) << endl; gives a 1 5 while Pari says 1/6*a 1/6 5 but I'm of the opinion it should be 1/6*a 1/6 5/6 I would fix it in ginac but what's the official definition of content? Regards, ralf
Hi! On Fri, Jul 02, 2004 at 11:31:36AM +0200, Ralf Stephan wrote:
cout << (10*x/2+ex(15)/3).content(x) << endl;
But that's 5x+5...? Anyway, content() and primpart() in GiNaC currently only work correctly for polynomials in Z[x]. But your Pari results are correct. The content of a polynomial in Q[x] should be calculated in a way that the primitive part is a polynomial in Z[x] with content 1. Bye, Christian -- / Physics is an algorithm \/ http://www.uni-mainz.de/~bauec002/
participants (2)
-
Christian Bauer
-
Ralf Stephan