]> www.ginac.de Git - ginac.git/commitdiff
synced to 1.1
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Mon, 30 Jun 2003 22:04:27 +0000 (22:04 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Mon, 30 Jun 2003 22:04:27 +0000 (22:04 +0000)
ginac/normal.cpp

index db35bb8ab805cddf6161dd0a72c89f669cdbb75f..5139509c51c59835947a0bef3d9dcd9bb51da049 100644 (file)
@@ -2069,13 +2069,20 @@ static ex frac_cancel(const ex &n, const ex &d)
 
        // Make denominator unit normal (i.e. coefficient of first symbol
        // as defined by get_first_symbol() is made positive)
-       const symbol *x;
-       if (get_first_symbol(den, x)) {
-               GINAC_ASSERT(is_exactly_a<numeric>(den.unit(*x)));
-               if (ex_to<numeric>(den.unit(*x)).is_negative()) {
+       if (is_exactly_a<numeric>(den)) {
+               if (ex_to<numeric>(den).is_negative()) {
                        num *= _ex_1;
                        den *= _ex_1;
                }
+       } else {
+               const symbol *x;
+               if (get_first_symbol(den, x)) {
+                       GINAC_ASSERT(is_exactly_a<numeric>(den.unit(*x)));
+                       if (ex_to<numeric>(den.unit(*x)).is_negative()) {
+                               num *= _ex_1;
+                               den *= _ex_1;
+                       }
+               }
        }
 
        // Return result as list