[GiNaC-list] code: extended gcd
ralf at ark.in-berlin.de
Mon Oct 4 19:41:03 CEST 2004
> Is the root of the problem the missing documentation of cofactors in the
> tutorial or am I missing something fundamental?!
Actually, yes, both, sorry. This code:
ex e1, e2;
cout << gcd(x-1, x*x*x, &e1, &e2, true) << "," << e1 << "," << e2 << endl;
where my function and Pari's bezout() gives
1,-1-x-x^2,1 (or a different order but you get the idea)
since -(x-1)(1+x+x^2) + x^3 = 1.
More information about the GiNaC-list