#14326: Substituting numeric one in symbolic expression gives symbolic one
------------------------------------+--------------------------
Reporter: zimmerma | Owner: AlexGhitza
Type: defect | Status: new
Priority: major | Milestone: sage-6.4
Component: basic arithmetic | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
------------------------------------+--------------------------
Comment (by kcrisman):
Okay, I think this ''might'' be a bug in Ginac, or possibly in how we
''use'' Ginac. In the Ginac definition of
[http://www.ginac.de/reference/power_8cpp_source.html#l00371 automatic
rewriting of power::eval], we have
{{{
00399 // ^(x,1) -> x
00400 if (eexponent.is_equal(_ex1))
00401 return basis;
...
00413 // ^(1,x) -> 1
00414 if (ebasis.is_equal(_ex1))
00415 return _ex1;
}}}
The other rewriting rules are probably harmless, though if
{{{
sage: z
x^n
sage: z.subs(x=0.)
0.000000000000000^n
sage: z.subs(x=0)
0^n
sage: z.subs(n=0)
1
sage: z.subs(n=0.)
1
}}}
where the `0^n` business is because Ginac checks if the exponent is
numerical because it doesn't want to evaluate something that could, in
principle, still become `0^0`.
Unfortunately, I'm not sure how to monkey-patch Pynac into recognizing
this situation, and I certainly don't want to do a catch in the symbolic
expression code, that is really the wrong place. Here's hoping someone
really intimately familiar with our back-and-forth to Pynac sees an easy
fix.
--
Ticket URL: <http://trac.sagemath.org/ticket/14326#comment:8>
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.