small inconsistency?

Ben Sapp bsapp at lanl.gov
Fri May 24 19:09:56 CEST 2002


Hi, 

Below I provide a small example program which I think illustrates a small 
inconsistency in GiNaC.   The program prints out 

x==4
x==4

and then exits.  I think that if the "==" operator were handled consistently 
with other operators it should print out

y==4
x==4

If I change the "==" operator to "+" it behaves as I expect.   

Cheers, 
Ben.  

-------------------------------------------------------------
#include <ginac/ginac.h>

using namespace GiNaC;

int 
main(int argc, char *argv[])
{
  symbol x("x"), y("y");

  // change the "==" to a "+" and it works as expected
  ex b = (x == 4);

  cout << b.subs(x == y) << std::endl;
  cout << b << std::endl;

  return 0;
}
-------------------------------------------------------------



More information about the GiNaC-list mailing list