Problem with series expansion

Chris Dams chrisd at sci.kun.nl
Thu Mar 25 19:51:32 CET 2004


Hello,

I found out that trying to calculate

ex(sqrt(1+x*x)*sqrt(1+2*x*x)).series(x,2)

throws an exception. This is because on the one hand the expansion of a
multiplication tries to find the ldegree of every factor and on the other
hand ldegree of a power throws if the base of the power contains the
variable and the exponent is non-integer. A patch is included.

Goodbye,
Chris Dams
-------------- next part --------------
===================================================================
RCS file: /home/cvs/GiNaC/ginac/pseries.cpp,v
retrieving revision 1.75
diff -r1.75 pseries.cpp
790c790,794
< 		int real_ldegree = buf.expand().ldegree(sym-r.rhs());
---
> 		int real_ldegree = 0;
> 		try {
> 			real_ldegree = buf.expand().ldegree(sym-r.rhs());
> 		}
> 		catch (std::runtime_error) {}


More information about the GiNaC-devel mailing list