#2462: Odd results when adding Laurent series
---------------------+------------------------------------------------------
 Reporter:  ljpk     |        Owner:  tbd       
     Type:  defect   |       Status:  new       
 Priority:  major    |    Milestone:  sage-3.2.1
Component:  algebra  |   Resolution:            
 Keywords:           |  
---------------------+------------------------------------------------------
Changes (by robertwb):

  * owner:  robertwb => tbd
  * component:  coercion => algebra

Comment:

 I really don't think this is due to coercion, as no coercion is going on
 here (all parents are identical, arithmetic is dispatched immediately).

 David Harvey is right, in polynomial_element.pyx:3672 we have

 {{{
         if p is None:
             for k from 0 <= k <= self.degree():
                 if self[k]:
                     return ZZ(k)
 }}}

 because self is not detected to be zero earlier (even though it really is)
 the loop exits without returning, hence the [boom]. The error, however,
 occurred earlier. Somewhere, something's not getting normalized like it
 should be. I think the error is in polynomials.

 Continuing on David's session,

 {{{
 sage: f = h.polynomial() - k.polynomial()
 sage: f
 0
 sage: sage: len(f.coeffs())
 500
 sage: k.degree()
 499
 sage: k[499]  # ?!!
 0
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/2462#comment:4>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to