#9524: Nasty bug with polynomial arithmetic and NTL contexts
--------------------------------+-------------------------------------------
   Reporter:  craigcitro        |       Owner:  AlexGhitza
       Type:  defect            |      Status:  new       
   Priority:  major             |   Milestone:            
  Component:  basic arithmetic  |    Keywords:            
     Author:                    |    Upstream:  N/A       
   Reviewer:                    |      Merged:            
Work_issues:                    |  
--------------------------------+-------------------------------------------
 I just ran into the following nasty bug:

 {{{
 sage: polygen(GF(49, 'a')) ; polygen(GF(9, 'a'))
 x
 x
 sage: x = polygen(GF(49, 'a'))
 sage: -x
 2*x
 sage: x + 0
 x
 sage: -x
 6*x
 }}}

 This is still present in sage-4.5.

 I think I know what the problem is, but I haven't had time to sit down and
 fix it. It's an issue with the NTL context being correctly restored when
 switching from 7 to 3 and back. There's a very nice note (by David Roe, I
 think) in most of the `_p` files in NTL that describes a pattern one must
 avoid to get context restoration right; unfortunately, the code generated
 by `sage.rings.polynomial.polynomial_zz_pex.pyx` (via
 `polynomial_template.pxi`) exactly conforms to this anti-pattern.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9524>
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.

Reply via email to