#11143: define symbolic functions for exponential integrals
-------------------------------------------------------------+--------------
Reporter: kcrisman | Owner:
benjaminfjones
Type: defect | Status:
needs_review
Priority: major | Milestone:
sage-5.1
Component: symbolics | Resolution:
Keywords: ei Ei special function maxima sd32 sd40.5 | Work issues:
Report Upstream: N/A | Reviewers:
Burcin Erocal, Karl-Dieter Crisman
Authors: Benjamin Jones | Merged in:
Dependencies: | Stopgaps:
-------------------------------------------------------------+--------------
Comment (by kcrisman):
I don't like this.
{{{
sage: li(0)
0
sage: type(li(0))
<type 'sage.rings.integer.Integer'>
sage: Si(0)
0
sage: type(Si(0))
<type 'sage.rings.integer.Integer'>
}}}
The reason is
{{{
# special case: z = 0
if isinstance(z, Expression):
if z.is_trivial_zero():
return z
else:
if not z:
return z
}}}
type code, because of course the zero `z` we input is not an expression,
but is `not z`, so we return the '''Integer''' zero instead of the
'''symbolic''' zero.
Of course, we're inconsistent here:
{{{
sage: sin(0)
0
sage: type(sin(0))
<type 'int'>
}}}
Oops. But under the philosophy of
{{{
sage: f(x) = x^2
sage: f(0)
0
sage: type(f(0))
<type 'sage.symbolic.expression.Expression'>
}}}
I think we should return an `Expression`.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11143#comment:55>
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.