# HG changeset patch
# User Titus Nicolae <nicolaetitus12@gmail.com>
# Date 1336851175 7200
# Node ID 329827139f0960a2427141901bd58c3315c95e46
# Parent 6eda1f634b03c9b725a1bacd854d85b1aa22df90
Doctest changes after atan(0,0) started raising an error in Pynac.
diff git a/sage/functions/other.py b/sage/functions/other.py
a

b


1657  1657  arg(sqrt(2) + I) 
1658  1658  
1659  1659  """ 
1660   if not isinstance(x,Expression): 
1661   # x contains no variables 
1662   if is_inexact(x): 
1663   # inexact complex numbers, e.g. 2.0+i 
1664   return self._evalf_(x, parent(x)) 
 1660  if not isinstance(x,Expression): # x contains no variables 
 1661  if parent(x)(0)==x: #compatibility with maxima 
 1662  return parent(x)(0) 
1665  1663  else: 
1666   # exact complex numbers, e.g. 2+i 
1667   return arctan2(imag_part(x),real_part(x)) 
 1664  if is_inexact(x): # inexact complex numbers, e.g. 2.0+i 
 1665  return self._evalf_(x, parent(x)) 
 1666  else: # exact complex numbers, e.g. 2+i 
 1667  return arctan2(imag_part(x),real_part(x)) 
1668  1668  else: 
1669  1669  # x contains variables, e.g. 2+i+y or 2.0+i+y 
1670  1670  # or x involves an expression such as sqrt(2) 
diff git a/sage/functions/trig.py b/sage/functions/trig.py
a

b


853  853  
854  854  sage: arctan2(0, log(2)).n() 
855  855  3.14159265358979 
 856  
 857  Check if atan2(0,0) throws error #11423:: 
 858  
 859  sage: atan2(0,0) 
 860  Traceback (most recent call last): 
 861  ... 
 862  RuntimeError: arctan2_eval(): arctan2(0,0) encountered 
 863  
 864  sage: atan2(0,0,hold=True) 
 865  arctan2(0, 0) 
 866  
 867  sage: atan2(0,0,hold=True).n() 
 868  Traceback (most recent call last): 
 869  ... 
 870  ValueError: arctan2(0,0) undefined 
 871  
856  872  """ 
857  873  GinacFunction.__init__(self, "arctan2", nargs=2, latex_name=r'\arctan', 
858  874  conversions=dict(maxima='atan2', sympy='atan2')) 
diff git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
a

b


5661  5661  0.0 
5662  5662  sage: maxima('atan2(0,0.6)') 
5663  5663  0.0 
5664   sage: SR(0).arctan2(0) 
5665   0 
5666   
 5664  sage: SR(0).arctan2(0) #11423 
 5665  Traceback (most recent call last): 
 5666  ... 
 5667  RuntimeError: arctan2_eval(): arctan2(0,0) encountered 
5667  5668  sage: SR(I).arctan2(1) 
5668  5669  arctan2(I, 1) 
5669  5670  sage: SR(CDF(0,1)).arctan2(1) 