Opened 7 years ago

Last modified 5 years ago

#16587 closed defect

evaluation of sgn(expr) fails — at Initial Version

Reported by: rws Owned by:
Priority: major Milestone: sage-7.3
Component: symbolics Keywords: sgn, evaluation
Cc: kcrisman Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


As reported in 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/ in sage.symbolic.expression.Expression._numerical_approx (build/cythonized/sage/symbolic/expression.cpp:24086)()

TypeError: cannot evaluate symbolic expression numerically


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)).

Change History (0)

Note: See TracTickets for help on using tickets.