- Fix thinko in csgn_eval().
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Tue, 15 May 2001 23:26:41 +0000 (23:26 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Tue, 15 May 2001 23:26:41 +0000 (23:26 +0000)
ginac/inifcns.cpp

index 0daa979..3bf0b2f 100644 (file)
@@ -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();
 }