Ticket #5739: 5739-complex-zeta-with-header.patch

File 5739-complex-zeta-with-header.patch, 1.5 KB (added by davidloeffler, 9 years ago)

Version with Mercurial header

  • sage/rings/complex_double.pyx

    # HG changeset patch
    # User Robert Bradshaw <robertwb@math.washington.edu>
    # Date 1285582286 -3600
    # Node ID 30e18d8fdead2bf100c82bde6674241c379aa5f0
    # Parent  5ac4a880d6bea25016621313c71631451a7800af
    #5739, complex zeta segfaults on pole at 1
    
    diff -r 5ac4a880d6be -r 30e18d8fdead 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 5ac4a880d6be -r 30e18d8fdead 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):