Skip to content

Commit

Permalink
Merge pull request #1293 from skirpichev/fix-1262
Browse files Browse the repository at this point in the history
series: correct branch handling for log()
  • Loading branch information
skirpichev committed Feb 21, 2023
2 parents da60cc8 + 57685c7 commit ca1af5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions diofant/functions/elementary/exponential.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ def _eval_nseries(self, x, n, logx):
log_series += Order(t**n, x)
# branch handling
if c.is_negative:
if t.is_Order:
return self._eval_nseries(x, n + 1, logx)
l = floor(arg(t.removeO()*c)/(2*pi)).limit(x, 0)
if l.is_finite:
log_series += 2*I*pi*l
Expand Down
3 changes: 3 additions & 0 deletions diofant/tests/calculus/test_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ def test_basic6():
assert limit(log(1/x) + 1/sin(x), x, 0) == oo
assert limit(log(1/x) + 1/x, x, 0) == oo

# issue diofant/diofant#1262
assert limit(I*exp(I*x)*log(exp(I*x)), x, -pi) == -pi


def test_sympyissue_3885():
assert limit(x*y + x*z, z, 2) == x*y + 2*x
Expand Down

0 comments on commit ca1af5c

Please sign in to comment.