summaryrefslogtreecommitdiff
path: root/dev-python/sympy/files/sympy-1.1.1-zeta.patch
blob: d9bab8096facb8bc1396aa2783261aee354da239 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
diff -U2 -r sympy-1.1.1.orig/sympy/functions/special/zeta_functions.py sympy-1.1.1/sympy/functions/special/zeta_functions.py
--- sympy-1.1.1.orig/sympy/functions/special/zeta_functions.py	2017-07-22 05:17:42.000000000 +0700
+++ sympy-1.1.1/sympy/functions/special/zeta_functions.py	2017-07-28 06:35:28.477927184 +0700
@@ -272,4 +272,5 @@
     @classmethod
     def eval(cls, s, z):
+        from sympy import unpolarify
         if z == 1:
             return zeta(s)
@@ -277,5 +278,11 @@
             return -dirichlet_eta(s)
         elif z == 0:
-            return 0
+            return S.Zero
+
+        # branch handling
+        if (1 - abs(z)).is_nonnegative:
+            newz = unpolarify(z)
+            if newz != z:
+                return cls(s, newz)
 
     def fdiff(self, argindex=1):
@@ -483,5 +490,5 @@
     For `\operatorname{Re}(s) > 0`, this function is defined as
 
-    .. math:: \eta(s) = \sum_{n=1}^\infty \frac{(-1)^n}{n^s}.
+    .. math:: \eta(s) = \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n^s}.
 
     It admits a unique analytic continuation to all of :math:`\mathbb{C}`.