# Ticket #12289: trac_12289-more-alg.patch

File trac_12289-more-alg.patch, 5.1 KB (added by kcrisman, 9 years ago)
• ## sage/functions/exp_integral.py

```# HG changeset patch
# User Karl-Dieter Crisman <kcrisman@gmail.com>
# Date 1371611484 14400
# Node ID 58f03801e64d798eeea1f0d8edded0e20a877ce6
# Parent  43e9f42f159040ff5ffe3c952e85d90af1657338
Trac 12289 - adding algorithm keyword to functions added later

diff --git a/sage/functions/exp_integral.py b/sage/functions/exp_integral.py```
 a return None # leaves the expression unevaluated def _evalf_(self, n, z, parent=None): def _evalf_(self, n, z, parent=None, algorithm=None): """ EXAMPLES:: return None # leaves the expression unevaluated def _evalf_(self, z, parent=None): def _evalf_(self, z, parent=None, algorithm=None): """ EXAMPLES:: return z return None # leaves the expression unevaluated def _evalf_(self, z, parent=None): def _evalf_(self, z, parent=None, algorithm=None): """ EXAMPLES:: # If we return:(li(z)-li(2)) we get correct symbolic integration. # But on definite integration it returns x.xxxx-li(2). def _evalf_(self, z, parent=None): def _evalf_(self, z, parent=None, algorithm=None): """ EXAMPLES:: return None # leaves the expression unevaluated def _evalf_(self, z, parent=None): def _evalf_(self, z, parent=None, algorithm=None): """ EXAMPLES: return None # leaves the expression unevaluated def _evalf_(self, z, parent=None): def _evalf_(self, z, parent=None, algorithm=None): """ EXAMPLES:: return None # leaves the expression unevaluated def _evalf_(self, z, parent=None): def _evalf_(self, z, parent=None, algorithm=None): """ EXAMPLES:: return None def _evalf_(self, z, parent=None): def _evalf_(self, z, parent=None, algorithm=None): """ EXAMPLES:: return self._evalf_(x, parent(x)) return None def _evalf_(self, x, parent=None): def _evalf_(self, x, parent=None, algorithm=None): """ EXAMPLES::
• ## sage/functions/log.py

`diff --git a/sage/functions/log.py b/sage/functions/log.py`
 a return sage_structure_coerce_parent(z)(Integer(-1)) return None def _evalf_(self, n, z, parent=None): def _evalf_(self, n, z, parent=None, algorithm=None): """ EXAMPLES::
• ## sage/functions/other.py

`diff --git a/sage/functions/other.py b/sage/functions/other.py`
 a # or x involves an expression such as sqrt(2) return None def _evalf_(self, x, parent_d=None): def _evalf_(self, x, parent_d=None, algorithm=None): """ EXAMPLES:: 3.14159265358979 sage: arg(2.0+3*i) 0.982793723247329 TESTS:: sage: C = arg(5+I) sage: C.n() """ try: return x.arg()
• ## sage/symbolic/expression.pyx

`diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx`
 a R_complex = R.complex_field() except (TypeError, AttributeError): raise err res = self._gobj.evalf(0, {'parent':R}) res = self._gobj.evalf(0, {'parent':R_complex}) if is_a_numeric(res): return R(py_object_from_numeric(res)) else:
• ## sage/symbolic/function.pyx

`diff --git a/sage/symbolic/function.pyx b/sage/symbolic/function.pyx`
 a sage: class my_function(SymbolicFunction): ....:     def __init__(self): ....:         SymbolicFunction.__init__(self, 'foo', nargs=2) ....:     def _evalf_(self, x, y, parent=None): ....:     def _evalf_(self, x, y, parent=None, algorithm=None): ....:         return x*y*2r ....:     def _conjugate_(self, x, y): ....:         return x
• ## sage/symbolic/pynac.pyx

`diff --git a/sage/symbolic/pynac.pyx b/sage/symbolic/pynac.pyx`
 a 1.0*I sage: py_float(pi, {'parent':RealField(100)}) 3.1415926535897932384626433833 sage: py_float(10, CDF) sage: py_float(10, {'parent':CDF}) 10.0 sage: type(py_float(10, {'parent':CDF})) sage: py_float(1/2, {'parent':CC})) sage: py_float(1/2, {'parent':CC}) 0.500000000000000 sage: type(py_float(1/2, {'parent':CC}))