decomp_rational(pow(x,-2),x) fails with MemoryError

Pearu Peterson pearu at cens.ioc.ee
Thu Dec 20 11:48:55 CET 2001


Hi!

Note that the following program fails to compute
decomp_rational(pow(x,-2),x)

#include <iostream>
#include <ginac/ginac.h>
using namespace std;
using namespace GiNaC;

int main()
{
    symbol x("x");
    cout << "r="<<decomp_rational(pow(x,-2),x) << endl;
    return 0;
}

while for decomp_rational(pow(x,-1),x) it succeeds. Any ideas why
decomp_rational fails in the previous case, in fact, it seems to fail for
all n>1 in x**-n.

I am using latest GiNaC from CVS on woody debian.

Regards,
	Pearu





More information about the GiNaC-devel mailing list