bug: get_precedence() is not working

Pearu Peterson pearu at cens.ioc.ee
Wed May 16 12:42:16 CEST 2001


Hi again,

The output of, for example

#include <ginac/ginac.h>
using namespace GiNaC;
main() {
  symbol x("x"), y("y");
  std::cout << ex_to_add(x+y).get_precedence() << std::endl;
}

should be

40

but I am getting

70

It seems to me that one has to define for each class, that redefines
basic::precedence, also the get_precedence() function. Clearly it is not
C++ way, but may be it is due to that basic::precedence is defined static.
Sorry, but right now I don't have any idea how to fix it...

Pearu




More information about the GiNaC-devel mailing list