function has

Tatiana Zolo zolo at cs.unipr.it
Thu May 9 10:58:34 CEST 2002


Hi,
the behavior of function 'has' in ginsh seems inexplicable:

ginsh - GiNaC Interactive Shell (GiNaC V1.0.8)
  __,  _______  Copyright (C) 1999-2002 Johannes Gutenberg University
Mainz,
 (__) *       | Germany.  This is free software with ABSOLUTELY NO
WARRANTY.
  ._) i N a C | You are welcome to redistribute it under certain
conditions.
<-------------' For details type `warranty;'.

Type ?? for a list of help topics.
> has(b*x*x^a, $0*$1*$1^$2);
1
> has(c*x*x^a, $0*$1*$1^$2);
1
> has(d*x*x^a, $0*$1*$1^$2);
1
> has(e*x*x^a, $0*$1*$1^$2);
0
> has(f*x*x^a, $0*$1*$1^$2);
1
> has(g*x*x^a, $0*$1*$1^$2);
1
> has(h*x*x^a, $0*$1*$1^$2);
1
> has(i*x*x^a, $0*$1*$1^$2);
0
> has(l*x*x^a, $0*$1*$1^$2);
1
> exit;

Then I cosed and opened again ginsh and ...

Type ?? for a list of help topics.
> has(e*x*x^a, $0*$1*$1^$2);
1
> has(f*x*x^a, $0*$1*$1^$2);
1
> has(g*x*x^a, $0*$1*$1^$2);
1
> has(h*x*x^a, $0*$1*$1^$2);
0
> has(i*x*x^a, $0*$1*$1^$2);
1
> has(l*x*x^a, $0*$1*$1^$2);
1
> has(m*x*x^a, $0*$1*$1^$2);
1
> has(n*x*x^a, $0*$1*$1^$2);
0
> has(o*x*x^a, $0*$1*$1^$2);
1
> exit;
[zolo at sandbox zolo]$ ginsh
ginsh - GiNaC Interactive Shell (GiNaC V1.0.8)
  __,  _______  Copyright (C) 1999-2002 Johannes Gutenberg University
Mainz,
 (__) *       | Germany.  This is free software with ABSOLUTELY NO
WARRANTY.
  ._) i N a C | You are welcome to redistribute it under certain
conditions.
<-------------' For details type `warranty;'.

Type ?? for a list of help topics.
> has(h*x*x^a, $0*$1*$1^$2);
1
> has(i*x*x^a, $0*$1*$1^$2);
1
> has(l*x*x^a, $0*$1*$1^$2);
1
> has(m*x*x^a, $0*$1*$1^$2);
0
> has(n*x*x^a, $0*$1*$1^$2);
1
>


Furthermore, with the number it says always false, is it right?

> has(2*x*x^a, $0*$1*$1^$2);
0
> has((-2)*x*x^a, $0*$1*$1^$2);
0
> has(sqrt(2)*x*x^a, $0*$1*$1^$2);
0

Thank you very much. Best regards

Tatiana Zolo




More information about the GiNaC-list mailing list