From b53d1b04c827a2f9f98c6d5e7a4b9fb27528c16e Mon Sep 17 00:00:00 2001 From: Stepan Roucka Date: Fri, 29 Aug 2008 13:41:10 +0200 Subject: [PATCH] fix limits of polynomials at infinity (#1061) Signed-off-by: Kirill Smelkov --- sympy/series/limits.py | 2 +- sympy/series/tests/test_limits.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sympy/series/limits.py b/sympy/series/limits.py index fec0575..be71fe0 100644 --- a/sympy/series/limits.py +++ b/sympy/series/limits.py @@ -61,7 +61,7 @@ def limit(e, z, z0, dir="+"): return -S.Infinity if e.is_Add: - if e.is_polynomial(): + if e.is_polynomial() and z0.is_finite: return Add(*[limit(term, z, z0, dir) for term in e.args]) else: # this is a case like limit(x*y+x*z, z, 2) == x*y+2*x diff --git a/sympy/series/tests/test_limits.py b/sympy/series/tests/test_limits.py index 8d2fbc8..4386df3 100644 --- a/sympy/series/tests/test_limits.py +++ b/sympy/series/tests/test_limits.py @@ -16,6 +16,7 @@ def test_basic1(): assert limit(exp(x)/x,x,oo) == oo assert limit(1/x-exp(-x),x,oo) == 0 assert limit(x+1/x,x,oo) == oo + assert limit(x-x**2,x,oo) == -oo def test_basic2(): -- 2.11.4.GIT