diff r f7e8996928f1 r eeed7c13d168 sage/rings/complex_number.pyx
a

b


1865  1865  0.58215806  0.92684856*I 
1866  1866  sage: zeta(z) 
1867  1867  0.58215806  0.92684856*I 
 1868  
 1869  sage: CC(1).zeta() 
 1870  Infinity 
 1871  sage: zeta(1) 
 1872  Infinity 
1868  1873  """ 
 1874  if mpfr_zero_p(self.__im) and mpfr_cmp_ui(self.__re, 1) == 0: 
 1875  import infinity 
 1876  return infinity.unsigned_infinity 
1869  1877  return self._parent(self._pari_().zeta()) 
1870  1878  
1871  1879  def algdep(self, n, **kwds): 
diff r f7e8996928f1 r eeed7c13d168 sage/rings/real_double.pyx
a

b


2132  2132  r""" 
2133  2133  Return the Riemann zeta function evaluated at this real number. 
2134  2134  
2135   .. note:: 
2136   
2137   PARI is vastly more efficient at computing the Riemann zeta 
2138   function. See the example below for how to use it. 
2139   
2140  2135  EXAMPLES:: 
2141  2136  
2142  2137  sage: RDF(2).zeta() 
… 
… 

2146  2141  sage: RDF(2).zeta() # slightly randomish arch dependent output 
2147  2142  2.37378795339e18 
2148  2143  sage: RDF(1).zeta() 
2149   +infinity 
 2144  Infinity 
2150  2145  """ 
2151  2146  if self._value == 1: 
2152   return self._new_c(1)/self._new_c(0) 
 2147  import infinity 
 2148  return infinity.unsigned_infinity 
2153  2149  return self._new_c(gsl_sf_zeta(self._value)) 
2154  2150  
2155  2151  def algdep(self, n): 
diff r f7e8996928f1 r eeed7c13d168 sage/rings/real_mpfr.pyx
a

b


3928  3928  sage: R(2).zeta() 
3929  3929  0.000000000000000 
3930  3930  sage: R(1).zeta() 
3931   +infinity 
 3931  Infinity 
3932  3932  
3933  3933  Computing zeta using PARI is much more efficient in difficult 
3934  3934  cases. Here's how to compute zeta with at least a given precision:: 
… 
… 

3954  3954  sage: R(z) 
3955  3955  1.64493406684823 
3956  3956  """ 
3957   cdef RealNumber x 
3958   x = self._new() 
 3957  if mpfr_cmp_ui(self.value, 1) == 0: 
 3958  import infinity 
 3959  return infinity.unsigned_infinity 
 3960  cdef RealNumber x = self._new() 
3959  3961  _sig_on 
3960  3962  mpfr_zeta(x.value, self.value, (<RealField>self._parent).rnd) 
3961  3963  _sig_off 