#6949: add symbolic max and min functions
-----------------------------+----------------------------------------------
Reporter: burcin | Owner: burcin
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.4.1
Component: symbolics | Keywords:
Author: Burcin Erocal | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
Changes (by lfousse):
* status: needs_review => needs_work
Comment:
I applied the patch on top of 4.3.5:
{{{
sage: f(x) = max_symbolic(sin(x), cos(x))
sage: f(0)
1
sage: f
x |--> max(sin(x), cos(x))
sage: f(1)
max(sin(1), cos(1))
}}}
So far, so good. But:
{{{
sage: N(f(1))
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/opt/sage-4.3.5/<ipython console> in <module>()
/opt/sage-4.3.5/local/lib/python2.6/site-packages/sage/misc/functional.pyc
in numerical_approx(x, prec, digits)
1161 prec = int((digits+1) * 3.32192) + 1
1162 try:
-> 1163 return x.numerical_approx(prec)
1164 except AttributeError:
1165 from sage.rings.complex_double import
is_ComplexDoubleElement
/opt/sage-4.3.5/local/lib/python2.6/site-
packages/sage/symbolic/expression.so in
sage.symbolic.expression.Expression.n
(sage/symbolic/expression.cpp:17043)()
TypeError: cannot evaluate symbolic expression numerically
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6949#comment:5>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.