# HG changeset patch
# User Volker Braun <vbraun@stp.dias.ie>
# Date 1337093612 7200
# Node ID 7d14009cc1693eaeabeb27ca4e955a512fe8b8e6
# Parent 765a4b54b75306e2e72c2a44c751025eb06b8ec3
Trac #12950: Fix doctests after infinities rewrite in Pynac.
diff git a/sage/functions/other.py b/sage/functions/other.py
a

b


791  791  sage: log_gamma(2) 
792  792  +Infinity 
793  793  sage: conjugate(log_gamma(2)) 
794   conjugate(+Infinity) 
 794  +Infinity 
795  795  """ 
796  796  GinacFunction.__init__(self, "log_gamma", latex_name=r'\log\Gamma', 
797  797  conversions={'mathematica':'LogGamma','maxima':'log_gamma'}) 
diff git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
a

b


207  207  
208  208  OUTPUT: 
209  209  
210   The python object corresponding to this expression, assuming 
211   this expression is a single numerical value. Otherwise, a 
212   TypeError is raised. 
 210  The Python object corresponding to this expression, assuming 
 211  this expression is a single numerical value or an infinity 
 212  representable in Python. Otherwise, a ``TypeError`` is raised. 
213  213  
214  214  EXAMPLES:: 
215  215  
… 
… 

233  233  sage: SR(I*oo).pyobject() 
234  234  Traceback (most recent call last): 
235  235  ... 
236   ValueError: Python infinity cannot have complex phase. 
 236  TypeError: Python infinity cannot have complex phase. 
237  237  """ 
238  238  cdef GConstant* c 
239  239  if is_a_constant(self._gobj): 
… 
… 

2248  2248  sage: nsr(oo)  nsr(oo) 
2249  2249  Traceback (most recent call last): 
2250  2250  ... 
2251   RuntimeError: indeterminate expression: Infinity  Infinity encountered. 
 2251  RuntimeError: indeterminate expression: infinity  infinity encountered. 
2252  2252  sage: nsr(oo)  nsr(oo) 
2253  2253  Traceback (most recent call last): 
2254  2254  ... 
2255   RuntimeError: indeterminate expression: Infinity  Infinity encountered. 
 2255  RuntimeError: indeterminate expression: infinity  infinity encountered. 
2256  2256  
2257  2257  sage: nsr(unsigned_infinity) + nsr(oo) 
2258  2258  Traceback (most recent call last): 
2259  2259  ... 
2260   RuntimeError: indeterminate expression: unsigned_infinity + x where x is Infinity, Infinity or unsigned infinity encountered. 
 2260  RuntimeError: indeterminate expression: unsigned_infinity + infinity encountered. 
2261  2261  sage: nsr(unsigned_infinity)  nsr(oo) 
2262  2262  Traceback (most recent call last): 
2263  2263  ... 
2264   RuntimeError: indeterminate expression: unsigned_infinity + x where x is Infinity, Infinity or unsigned infinity encountered. 
 2264  RuntimeError: indeterminate expression: unsigned_infinity + infinity encountered. 
2265  2265  sage: nsr(oo) + nsr(unsigned_infinity) 
2266  2266  Traceback (most recent call last): 
2267  2267  ... 
2268   RuntimeError: indeterminate expression: unsigned_infinity + x where x is Infinity, Infinity or unsigned infinity encountered. 
 2268  RuntimeError: indeterminate expression: unsigned_infinity + infinity encountered. 
2269  2269  sage: nsr(oo)  nsr(unsigned_infinity) 
2270  2270  Traceback (most recent call last): 
2271  2271  ... 
2272   RuntimeError: indeterminate expression: unsigned_infinity + x where x is Infinity, Infinity or unsigned infinity encountered. 
 2272  RuntimeError: indeterminate expression: unsigned_infinity + infinity encountered. 
2273  2273  sage: nsr(unsigned_infinity) + nsr(unsigned_infinity) 
2274   Traceback (most recent call last): 
2275   ... 
2276   RuntimeError: indeterminate expression: unsigned_infinity + x where x is Infinity, Infinity or unsigned infinity encountered. 
2277   
2278   
 2274  Infinity 
2279  2275  """ 
2280  2276  cdef GEx x 
2281  2277  cdef Expression _right = <Expression>right 
… 
… 

2431  2427  :: 
2432  2428  
2433  2429  sage: x*oo 
2434   +Infinity 
2435   sage: x*oo 
2436   Infinity 
 2430  Traceback (most recent call last): 
 2431  ... 
 2432  ArithmeticError: indeterminate expression: infinity * f(x) encountered. 
2437  2433  sage: x*unsigned_infinity 
2438  2434  Traceback (most recent call last): 
2439  2435  ... 
… 
… 

2506  2502  sage: x/oo 
2507  2503  0 
2508  2504  sage: oo/x 
2509   +Infinity 
 2505  Traceback (most recent call last): 
 2506  ... 
 2507  RuntimeError: indeterminate expression: infinity * f(x) encountered. 
2510  2508  
2511  2509  sage: SR(oo)/SR(oo) 
2512  2510  Traceback (most recent call last): 
2513  2511  ... 
2514   RuntimeError: indeterminate expression: 0*infinity encountered. 
 2512  RuntimeError: indeterminate expression: 0 * infinity encountered. 
2515  2513  
2516  2514  sage: SR(oo)/SR(oo) 
2517  2515  Traceback (most recent call last): 
2518  2516  ... 
2519   RuntimeError: indeterminate expression: 0*infinity encountered. 
 2517  RuntimeError: indeterminate expression: 0 * infinity encountered. 
2520  2518  
2521  2519  sage: SR(oo)/SR(oo) 
2522  2520  Traceback (most recent call last): 
2523  2521  ... 
2524   RuntimeError: indeterminate expression: 0*infinity encountered. 
 2522  RuntimeError: indeterminate expression: 0 * infinity encountered. 
2525  2523  
2526  2524  sage: SR(oo)/SR(unsigned_infinity) 
2527  2525  Traceback (most recent call last): 
2528  2526  ... 
2529   RuntimeError: indeterminate expression: 0*infinity encountered. 
 2527  RuntimeError: indeterminate expression: 0 * infinity encountered. 
2530  2528  
2531  2529  sage: SR(unsigned_infinity)/SR(oo) 
2532  2530  Traceback (most recent call last): 
2533  2531  ... 
2534   RuntimeError: indeterminate expression: 0*infinity encountered. 
 2532  RuntimeError: indeterminate expression: 0 * infinity encountered. 
2535  2533  
2536  2534  sage: SR(0)/SR(oo) 
2537  2535  0 
… 
… 

2676  2674  sage: x^oo 
2677  2675  Traceback (most recent call last): 
2678  2676  ... 
2679   ValueError: power::eval(): pow(x, Infinity) for non numeric x is not defined. 
 2677  ValueError: power::eval(): pow(f(x), infinity) is not defined. 
2680  2678  sage: SR(oo)^2 
2681  2679  +Infinity 
2682  2680  sage: SR(oo)^2 
… 
… 

3576  3574  sage: (x/y).subs(y=oo) 
3577  3575  0 
3578  3576  sage: (x/y).subs(x=oo) 
3579   +Infinity 
 3577  Traceback (most recent call last): 
 3578  ... 
 3579  RuntimeError: indeterminate expression: infinity * f(x) encountered. 
3580  3580  sage: (x*y).subs(x=oo) 
3581   +Infinity 
 3581  Traceback (most recent call last): 
 3582  ... 
 3583  RuntimeError: indeterminate expression: infinity * f(x) encountered. 
3582  3584  sage: (x^y).subs(x=oo) 
3583  3585  Traceback (most recent call last): 
3584  3586  ... 
3585   ValueError: power::eval(): pow(Infinity, x) for non numeric x is not defined. 
 3587  ValueError: power::eval(): pow(Infinity, f(x)) is not defined. 
3586  3588  sage: (x^y).subs(y=oo) 
3587  3589  Traceback (most recent call last): 
3588  3590  ... 
3589   ValueError: power::eval(): pow(x, Infinity) for non numeric x is not defined. 
 3591  ValueError: power::eval(): pow(f(x), infinity) is not defined. 
3590  3592  sage: (x+y).subs(x=oo) 
3591  3593  +Infinity 
3592  3594  sage: (xy).subs(y=oo) 
… 
… 

5722  5724  sage: SR(1).arctan2(CDF(0,1)) 
5723  5725  arctan2(1, 1.0*I) 
5724  5726  
 5727  sage: arctan2(0,oo) 
 5728  0 
5725  5729  sage: SR(oo).arctan2(oo) 
5726   Traceback (most recent call last): 
5727   ... 
5728   RuntimeError: arctan2_eval(): arctan2(infinity, infinity) encountered 
 5730  1/4*pi 
5729  5731  sage: SR(oo).arctan2(0) 
5730   0 
 5732  1/2*pi 
5731  5733  sage: SR(oo).arctan2(0) 
 5734  1/2*pi 
 5735  sage: SR(oo).arctan2(2) 
5732  5736  pi 
5733   sage: SR(oo).arctan2(2) 
5734   pi 
5735  5737  sage: SR(unsigned_infinity).arctan2(2) 
5736  5738  Traceback (most recent call last): 
5737  5739  ... 
5738   RuntimeError: arctan2_eval(): arctan2(unsigned_infinity, x) encountered 
 5740  RuntimeError: arctan2_eval(): arctan2(x, unsigned_infinity) encountered 
5739  5741  sage: SR(2).arctan2(oo) 
5740  5742  1/2*pi 
5741  5743  sage: SR(2).arctan2(oo) 
… 
… 

5743  5745  sage: SR(2).arctan2(SR(unsigned_infinity)) 
5744  5746  Traceback (most recent call last): 
5745  5747  ... 
5746   RuntimeError: arctan2_eval(): arctan2(x, unsigned_infinity) encountered 
 5748  RuntimeError: arctan2_eval(): arctan2(unsigned_infinity, x) encountered 
5747  5749  """ 
5748  5750  cdef Expression nexp = self.coerce_in(x) 
5749  5751  return new_Expression_from_GEx(self._parent, 