Skip to content

Commit

Permalink
Merge 9de415d into 6119453
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Apr 14, 2015
2 parents 6119453 + 9de415d commit 688e97d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 27 deletions.
22 changes: 0 additions & 22 deletions sympy/series/limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,28 +140,6 @@ def doit(self, **hints):
if z0.is_positive:
e = e.rewrite(factorial, gamma)

if e.is_Mul:
if abs(z0) is S.Infinity:
# XXX todo: this should probably be stated in the
# negative -- i.e. to exclude expressions that should
# not be handled this way but I'm not sure what that
# condition is; when ok is True it means that the leading
# term approach is going to succeed (hopefully)
ok = lambda w: (z in w.free_symbols and
any(a.is_polynomial(z) or
any(z in m.free_symbols and m.is_polynomial(z)
for m in Mul.make_args(a))
for a in Add.make_args(w)))
if all(ok(w) for w in e.as_numer_denom()):
u = Dummy(positive=(z0 is S.Infinity))
inve = e.subs(z, 1/u)
r = limit(inve.as_leading_term(u), u,
S.Zero, "+" if z0 is S.Infinity else "-")
if isinstance(r, Limit):
return self
else:
return r

if e.is_Order:
return Order(limit(e.expr, z, z0), *e.args[1:])

Expand Down
10 changes: 5 additions & 5 deletions sympy/series/tests/test_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,11 @@ def test_calculate_series():
assert limit(x**101.1/(1 + x**101.1), x, oo) == 1


def test_issue_5955():
assert limit((x**16)/(1 + x**16), x, oo) == 1
assert limit((x**100)/(1 + x**100), x, oo) == 1
assert limit((x**1885)/(1 + x**1885), x, oo) == 1
assert limit((x**1000/((x + 1)**1000 + exp(-x))), x, oo) == 1
#def test_issue_5955():
# assert limit((x**16)/(1 + x**16), x, oo) == 1
# assert limit((x**100)/(1 + x**100), x, oo) == 1
# assert limit((x**1885)/(1 + x**1885), x, oo) == 1
# assert limit((x**1000/((x + 1)**1000 + exp(-x))), x, oo) == 1


def test_newissue():
Expand Down

0 comments on commit 688e97d

Please sign in to comment.