Permalink
Browse files

Merge pull request #1208 from tsndiffopera/finallimit

To compute limits of e.is_Pow and resolve issue id #2455
  • Loading branch information...
2 parents 85c3335 + 68c851d commit c2db807296e4b4afd2e30cd74bdd366cae555d9d @smichr smichr committed Apr 6, 2012
Showing with 17 additions and 1 deletion.
  1. +1 −1 sympy/series/limits.py
  2. +16 −0 sympy/series/tests/test_limits.py
@@ -92,7 +92,7 @@ def limit(e, z, z0, dir="+"):
if ex.is_number:
if c is None:
base = b.subs(z, z0)
- if base.is_bounded and (ex.is_bounded or base is not S.One):
+ if base.is_finite and (ex.is_bounded or base is not S.One):
return base**ex
else:
if z0 == 0 and ex < 0:
@@ -33,6 +33,22 @@ def test_basic1():
assert limit(gamma(1/x + 3), x, oo) == 2
assert limit(S.NaN, x, -oo) == S.NaN
assert limit(Order(2)*x, x, S.NaN) == S.NaN
+ assert limit(Sum(1/x, (x, 1, y)) - 1/y, y, oo) == Sum(1/x, (x, 1, oo))
+ assert limit(gamma(1/x + 3), x, oo) == 2
+ assert limit(S.NaN, x, -oo) == S.NaN
+ assert limit(Order(2)*x, x, S.NaN) == S.NaN
+ assert limit(1/(x-1), x, 1, dir="+") == oo
+ assert limit(1/(x-1), x, 1, dir="-") == -oo
+ assert limit(1/(5-x)**3, x, 5, dir="+") == -oo
+ assert limit(1/(5-x)**3, x, 5, dir="-") == oo
+ assert limit(1/sin(x), x, pi, dir="+") == -oo
+ assert limit(1/sin(x), x, pi, dir="-") == oo
+ assert limit(1/cos(x), x, pi/2, dir="+") == -oo
+ assert limit(1/cos(x), x, pi/2, dir="-") == oo
+ assert limit(1/tan(x**3), x, (2*pi)**(S(1)/3), dir="+") == oo
+ assert limit(1/tan(x**3), x, (2*pi)**(S(1)/3), dir="-") == -oo
+ assert limit(1/cot(x)**3, x, (3*pi/2), dir="+") == -oo
+ assert limit(1/cot(x)**3, x, (3*pi/2), dir="-") == oo
# approaching 0
# from dir="+"

0 comments on commit c2db807

Please sign in to comment.