Fix algebraic power::has() for larger integer exponents.
[ginac.git] / ginac / power.cpp
index 1a4f57dbfe142741fc6117044f3c778673eb3389..8ec6380bcbd522cbabb7d8664905c79aed7e6fc3 100644 (file)
@@ -627,14 +627,12 @@ bool power::has(const ex & other, unsigned options) const
                return basic::has(other, options);
        if (exponent.info(info_flags::posint)
                        && other.op(1).info(info_flags::posint)
-                       && ex_to<numeric>(exponent).to_int()
-                                       > ex_to<numeric>(other.op(1)).to_int()
+                       && ex_to<numeric>(exponent) > ex_to<numeric>(other.op(1))
                        && basis.match(other.op(0)))
                return true;
        if (exponent.info(info_flags::negint)
                        && other.op(1).info(info_flags::negint)
-                       && ex_to<numeric>(exponent).to_int()
-                                       < ex_to<numeric>(other.op(1)).to_int()
+                       && ex_to<numeric>(exponent) < ex_to<numeric>(other.op(1))
                        && basis.match(other.op(0)))
                return true;
        return basic::has(other, options);