#9869: finite field bug
--------------------------------+-------------------------------------------
   Reporter:  mariah            |       Owner:  AlexGhitza
       Type:  defect            |      Status:  new       
   Priority:  major             |   Milestone:            
  Component:  basic arithmetic  |    Keywords:            
     Author:  Mariah Lenox      |    Upstream:  N/A       
   Reviewer:                    |      Merged:            
Work_issues:                    |  
--------------------------------+-------------------------------------------
 {{{
 # Demonstrate a finite field bug in which
 # a product of nonzero elements is equal to 0
 # (which should not happen in a field)
 #
 # This is the smallest example I could find. It seems salient that
 # the square of p is bigger than a 32-bit C integer. Larger values
 # for p also exhibit the bug, smaller ones do not.

 p = 2^16 + 1

 # Create a quadratic field extension
 K.<alpha> = GF(p^2)

 # Choose some non-zero element of K, use the random_element
 # method.
 x = K(0)
 while x == K(0):
   x = K.random_element()

 K.<alpha> = GF(p^2)  # this line is necessary for bug
 x_coerce = K(x)
 print 2*x_coerce  # prints zero
 }}}

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