#16587: evaluation of sgn(expr) fails
-------------------------+-----------------------------------
   Reporter:  rws        |            Owner:
       Type:  defect     |           Status:  new
   Priority:  major      |        Milestone:  sage-6.3
  Component:  symbolics  |         Keywords:  sgn, evaluation
  Merged in:             |          Authors:
  Reviewers:             |  Report Upstream:  N/A
Work issues:             |           Branch:
     Commit:             |     Dependencies:
   Stopgaps:             |
-------------------------+-----------------------------------
 As reported in http://ask.sagemath.org/question/8535/problem-with-sign-
 sgn-and-n/ by Louis Cypher:
 {{{
 sage: M = sgn(cos(3/2))
 sage: M.n()
 TypeError                                 Traceback (most recent call
 last)
 <ipython-input-5-0f11e9bd1e87> in <module>()
 ----> 1 M.n()

 /home/ralf/sage/local/lib/python2.7/site-
 packages/sage/symbolic/expression.so in
 sage.symbolic.expression.Expression._numerical_approx
 (build/cythonized/sage/symbolic/expression.cpp:24086)()

 TypeError: cannot evaluate symbolic expression numerically
 }}}
 kcrisman:

 Problem seems to be that in `M.n??` we see that it's looking for
 `is_a_numeric(x._gobj)` but apparently that fails, as does the constant,
 so it thinks we are looking at evaluating `sgn(cos(x))` instead of
 `sgn(cos(3/2))`.

--
Ticket URL: <http://trac.sagemath.org/ticket/16587>
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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to