Bug?: (a^b).unit(a) -> SIGSEGV
cbauer at student.physik.uni-mainz.de
Mon Dec 17 21:00:58 CET 2001
On Sun, Nov 25, 2001 at 02:21:44PM +0200, Pearu Peterson wrote:
> Notice that (a^b).unit(a) leads to Segmentation fault. [...]
> Any ideas?
My guess is that it enters an infinite recursion in unit() because
lcoeff(a^b,a) = a^b, and unit() expects the coefficient to not contain
the specified variable any more.
Technically, unit() is being called with illegal arguments as it
expects a polynomial and doesn't do any checking for speed reasons.
Maybe power::degree() should throw an exception if it has a non-integer
exponent instead of returning 0? I'm not sure whether this will break
/ Coding on PowerPC and proud of it
More information about the GiNaC-devel