Behavior of the function 'has'

Christian Bauer cbauer at
Wed Mar 13 15:49:59 CET 2002


On Tue, Mar 12, 2002 at 12:59:07PM +0100, Tatiana Zolo wrote:
> > has(2^x*3^x*4^x, 2^x);
> 1
> > has(2^x*3^x*4^x, 2^x*3^x);
> 0

has(e, x) returns true if and only if a subexpression of e (as defined by
op()) matches (as defined by match()) x (or e matches x entirely). "2^x*3^x"
is not a subexpression of "2^x*3^x*4^x" by this definition.

A workaround is to use

  > has(2^x*3^x*4^x, 2^x*3^x*$0);


  / Coding on PowerPC and proud of it

More information about the GiNaC-list mailing list