10 Mar
2006
10 Mar
'06
10:43 p.m.
For example csgn(x)^(1/2) where it later turns out that x==-1.
Now I see the ommision, this one should be better: static ex csgn_power(const ex & arg, const ex & exp) { if (is_a<numeric>(exp) && exp.info(info_flags::positive) && ex_to<numeric>(exp).is_integer()) { if (ex_to<numeric>(exp).is_odd()) return csgn(arg); else return power(csgn(arg), _ex2).hold(); } else return power(csgn(arg), exp).hold(); } Best, Vladimir -- Vladimir V. Kisil email: kisilv@maths.leeds.ac.uk -- www: http://maths.leeds.ac.uk/~kisilv/