#7712: _
--------------------------------+-------------------------------------------
Reporter: zimmerma | Owner: AlexGhitza
Type: defect | Status: new
Priority: major | Milestone: sage-4.3.4
Component: basic arithmetic | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------------+-------------------------------------------
Comment(by ylchapuy):
Replying to [comment:3 zimmerma]:
> C=C.subs(xk=R(0),sk1=R(1))
The two polynomials obtained here are constants.
The strange behaviour about the type comes from line 153 of
`sage/rings/polynomial/multi_polynomial_element.py`
where we find:
{{{
try:
K = x[0].parent()
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
except AttributeError:
K = self.parent().base_ring()
y = K(0)
for (m,c) in self.element().dict().iteritems():
y += c*misc.mul([ x[i]**m[i] for i in range(n) if m[i] != 0])
}}}
I don't know exactly why, but It first try to take the type of the first
input (here Integer 0) and this type is then changed only by coercion when
doing the computation.
With precision 391 the polynomial is null and no operations are performed,
so the results stays Integer.
I would say this is a bug but maybe there is a purpose behind this.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7712#comment:6>
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.