#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:
------------------------------------+--------------------------
Changes (by kcrisman):
* cc: burcin (added)
Comment:
Wow, this is weird. Here is a ''much'' simpler example.
{{{
sage: w(n) = n
sage: w(1.)
1.00000000000000
sage: w(n) = n^2
sage: w(1.)
1
}}}
In fact, even
{{{
sage: (x^2).subs(x=1.)
1
}}}
works. Yuck.
Somehow the custom power method is not doing its job when you substitute .
But I don't see an obvious place in Ginac where this would get screwed
up...
Aha.
{{{
sage: z = x^2
sage: z.subs(x=1.)
1
sage: z.subs(x=2.)
4.00000000000000
}}}
Because one does get treated differently. Though
{{{
sage: z = x
sage: z.subs(x=1.)
1.00000000000000
}}}
so it also has something to do with the coercion that happens in the power
method for symbolic expressions.
--
Ticket URL: <http://trac.sagemath.org/ticket/14326#comment:7>
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.