From a053768864556ce627f958a38fb1169ab00b8229 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Mon, 30 Jun 2003 22:04:27 +0000 Subject: [PATCH] synced to 1.1 --- ginac/normal.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ginac/normal.cpp b/ginac/normal.cpp index db35bb8a..5139509c 100644 --- a/ginac/normal.cpp +++ b/ginac/normal.cpp @@ -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(den.unit(*x))); - if (ex_to(den.unit(*x)).is_negative()) { + if (is_exactly_a(den)) { + if (ex_to(den).is_negative()) { num *= _ex_1; den *= _ex_1; } + } else { + const symbol *x; + if (get_first_symbol(den, x)) { + GINAC_ASSERT(is_exactly_a(den.unit(*x))); + if (ex_to(den.unit(*x)).is_negative()) { + num *= _ex_1; + den *= _ex_1; + } + } } // Return result as list -- 2.44.0