Ticket #5739: 5739-complex-zeta.patch

File 5739-complex-zeta.patch, 1.3 KB (added by robertwb, 9 years ago)

apply only this patch

  • sage/rings/complex_double.pyx

    #5739, complex zeta segfaults on pole at 1
    
    diff -r d8ce956f7f5c sage/rings/complex_double.pyx
    a b  
    21312131            0.582158059752 - 0.926848564331*I
    21322132            sage: zeta(z)
    21332133            0.582158059752 - 0.926848564331*I
     2134            sage: zeta(CDF(1))
     2135            Infinity
    21342136        """
     2137        if self._complex.dat[0] == 1 and self._complex.dat[1] == 0:
     2138            import infinity
     2139            return infinity.unsigned_infinity
    21352140        cdef pari_sp sp
    21362141        sp = avma
    21372142        return self._new_from_gen_c(  gzeta(self._gen(), PREC),   sp)
  • sage/rings/complex_number.pyx

    diff -r d8ce956f7f5c sage/rings/complex_number.pyx
    a b  
    20872087            0.58215806 - 0.92684856*I
    20882088            sage: zeta(z)
    20892089            0.58215806 - 0.92684856*I
     2090
     2091            sage: CC(1).zeta()
     2092            Infinity
    20902093        """
     2094        if mpfr_zero_p(self.__im) and mpfr_cmp_ui(self.__re, 1) == 0:
     2095            import infinity
     2096            return infinity.unsigned_infinity
    20912097        return self._parent(self._pari_().zeta())
    20922098
    20932099    def algdep(self, n, **kwds):