#16587: f(expr,hold).n() fails for all generalized functions
-------------------------+-------------------------------------------------
       Reporter:  rws    |        Owner:
           Type:         |       Status:  needs_review
  defect                 |
       Priority:  major  |    Milestone:  sage-7.3
      Component:         |   Resolution:
  symbolics              |
       Keywords:  sgn,   |    Merged in:
  evaluation             |
        Authors:  Ralf   |    Reviewers:  Paul Masson
  Stephan                |
Report Upstream:  N/A    |  Work issues:
         Branch:         |       Commit:
  u/rws/16587            |  e7159eb400a9ddf09b36c7a7c2d4b42be24df3bd
   Dependencies:         |     Stopgaps:
  #17130, #17285         |
-------------------------+-------------------------------------------------

Comment (by paulmasson):

 Doctests pass. `dirac_delta`, `heaviside`, `unit_step` and `sign` function
 as expected for real arguments.

 `kronecker_delta` returns an unexpected error for real arguments:

 {{{
 sage: kronecker_delta(1,2,hold=True).n()
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 <ipython-input-27-089ce283036d> in <module>()
 ----> 1 kronecker_delta(Integer(1),Integer(2),hold=True).n()

 /Users/Masson/Downloads/GitHub/sage/src/sage/symbolic/expression.pyx in
 sage.symbolic.expression.Expression._numerical_approx
 
(/Users/Masson/Downloads/GitHub/sage/src/build/cythonized/sage/symbolic/expression.cpp:31167)()
    5430             pass          # try again with complex
    5431             kwds['parent'] = R.complex_field()
 -> 5432             x = x._convert(kwds)
    5433
    5434         # we have to consider constants as well, since infinity is
 a constant

 /Users/Masson/Downloads/GitHub/sage/src/sage/symbolic/expression.pyx in
 sage.symbolic.expression.Expression._convert
 
(/Users/Masson/Downloads/GitHub/sage/src/build/cythonized/sage/symbolic/expression.cpp:9677)()
    1242             -0.989992496600445*sqrt(2)
    1243         """
 -> 1244         cdef GEx res = self._gobj.evalf(0, kwds)
    1245         return new_Expression_from_GEx(self._parent, res)
    1246

 TypeError: _evalf_() takes exactly 2 arguments (5 given)

 }}}

 Looks like its trying to evaluate arguments as complex numbers.

 And for future reference, is it expected practice for people to merge the
 current develop branch before pushing to Trac? Or is it a matter of how
 the branch is assembled, especially for older tickets, and I just need to
 pay attention to what gets pulled?

--
Ticket URL: <https://trac.sagemath.org/ticket/16587#comment:26>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to