#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):
Replying to [comment:13 burcin]:
Thanks for replying!
> Looking at the code snippet from comment:8 only, I don't think this is a
bug in Ginac. The intended behavior is just different in Pynac, so we have
to patch Pynac.
>
> Ginac wants to keep unique reference counted expression objects for
expressions that are equal. That is why they return `_ex1` on line 415. In
Pynac, we do not have a unique "one", we should just return `ebasis` in
this line to keep the precision/type of the base.
>
Of course! That makes perfect sense - once you say it, before it was
murky :(
What about for the other case, of `x^1.0`? We have
{{{
sage: (x^2).subs(x=1.)
1
sage: (2^x).subs(x=1.)
2
sage: (x^2).subs(x=2.)
4.00000000000000
sage: (2^x).subs(x=2.)
4.00000000000000
}}}
so it would seem that if the exponent is not exact, we want the whole
thing to be numerical. I guess we could just strip out that
simplification completely, but I don't know if that would give us anything
useful either.
--
Ticket URL: <http://trac.sagemath.org/ticket/14326#comment:14>
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.