index an ex? Re: strange bug

Ralf Stephan ralf at ark.in-berlin.de
Sat Jul 10 19:00:18 CEST 2004


>   ex e = (ex(1)/x).numer_denom();
>   e = e[0];

Should it be allowed at all to index an ex? I believe what happens is that
indexing through [] gets compiled to a call to operator*() which may
not always be intended. I have encountered here another bug that was
nearly untraceable with gdb but went away when I replaced e[0] with
e.op(0).


Just FYI,
ralf




More information about the GiNaC-devel mailing list