X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Finifcns.cpp;h=3bf0b2f7e9b93554c9344d357e848be1c9ba4aa3;hp=0daa97989abf8260202a0db99cfb572f576379ec;hb=d58aba5750e206575895725df80b65d907196928;hpb=be6aec558b8c229708075557b9887f74e532dec6 diff --git a/ginac/inifcns.cpp b/ginac/inifcns.cpp index 0daa9798..3bf0b2f7 100644 --- a/ginac/inifcns.cpp +++ b/ginac/inifcns.cpp @@ -82,7 +82,8 @@ static ex csgn_eval(const ex & arg) if (is_ex_exactly_of_type(arg, numeric)) return csgn(ex_to_numeric(arg)); - else if (is_ex_exactly_of_type(arg, mul)) { + else if (is_ex_of_type(arg, mul) && + is_ex_of_type(arg.op(arg.nops()-1),numeric)) { numeric oc = ex_to_numeric(arg.op(arg.nops()-1)); if (oc.is_real()) { if (oc > 0) @@ -101,7 +102,7 @@ static ex csgn_eval(const ex & arg) return -csgn(I*arg/oc).hold(); } } - + return csgn(arg).hold(); }