polylog: fix for integer-valued parameter with complex type
This commit is contained in:
@@ -481,9 +481,9 @@ def polylog(ctx, s, z):
|
||||
if abs(z) <= 0.75 or (not ctx.isint(s) and abs(z) < 0.9):
|
||||
return polylog_series(ctx, s, z)
|
||||
if abs(z) >= 1.4 and ctx.isint(s):
|
||||
return (-1)**(s+1)*polylog_series(ctx, s, 1/z) + polylog_continuation(ctx, s, z)
|
||||
return (-1)**(s+1)*polylog_series(ctx, s, 1/z) + polylog_continuation(ctx, int(ctx.re(s)), z)
|
||||
if ctx.isint(s):
|
||||
return polylog_unitcircle(ctx, int(s), z)
|
||||
return polylog_unitcircle(ctx, int(ctx.re(s)), z)
|
||||
return polylog_general(ctx, s, z)
|
||||
|
||||
@defun_wrapped
|
||||
|
||||
@@ -591,6 +591,8 @@ def test_polylog():
|
||||
# issue 390
|
||||
assert polylog(1.5, -48.910886523731889).ae(-6.272992229311817)
|
||||
assert polylog(1.5, 200).ae(-8.349608319033686529 - 8.159694826434266042j)
|
||||
assert polylog(-2+0j, -2).ae(mpf(1)/13.5)
|
||||
assert polylog(-2+0j, 1.25).ae(-180)
|
||||
|
||||
def test_bell_polyexp():
|
||||
mp.dps = 15
|
||||
|
||||
Reference in New Issue
Block a user