Ticket #5739: 5739-CDF-zeta.patch

File 5739-CDF-zeta.patch, 705 bytes (added by robertwb, 10 years ago)
  • sage/rings/complex_double.pyx

    #5739, CDF zeta doesn't segfaults on pole at 1.
    
    diff -r bbd14bd2b542 sage/rings/complex_double.pyx
    a b  
    20202020            0.582158059752 - 0.926848564331*I
    20212021            sage: zeta(z)
    20222022            0.582158059752 - 0.926848564331*I
     2023            sage: zeta(CDF(1))
     2024            Infinity
    20232025        """
     2026        if self._complex.dat[0] == 1 and self._complex.dat[1] == 0:
     2027            import infinity
     2028            return infinity.unsigned_infinity
    20242029        cdef pari_sp sp
    20252030        sp = avma
    20262031        return self._new_from_gen_c(  gzeta(self._gen(), PREC),   sp)