#12147: Binary NTL Finite field elements can't coerce to GF(2)
----------------------------+-----------------------------------------------
   Reporter:  jsrn          |          Owner:  AlexGhitza           
       Type:  defect        |         Status:  needs_review         
   Priority:  minor         |      Milestone:  sage-4.8             
  Component:  algebra       |       Keywords:  finite field, algebra
Work_issues:                |       Upstream:  N/A                  
   Reviewer:  Julian Rueth  |         Author:  Johan S.R. Nielsen   
     Merged:                |   Dependencies:                       
----------------------------+-----------------------------------------------
Changes (by saraedum):

  * reviewer:  => Julian Rueth


Comment:

 Your patch looks good. A few comments:

 Technically, {{{_integer_()}}} is a _conversion_ not a _coercion_ (the
 same docstring is also in the corresponding method of the givaro element).
 I believe it is cheaper to call {{{is_one()}}} and {{{is_zero()}}} than to
 do a comparison with 0 and 1:

 {{{
 sage: timeit('a == 0')
 625 loops, best of 3: 6.23 µs per loop
 sage: timeit('a.is_zero()')
 625 loops, best of 3: 437 ns per loop
 sage: timeit('a == 1')
 625 loops, best of 3: 6.21 µs per loop
 sage: timeit('a.is_zero()')
 625 loops, best of 3: 525 ns per loop
 }}}

 Also, I added double colons to get the formatting in the reference manual
 right.

 Anyway, if you are ok with my changes. Feel free to set it to
 positive_review.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12147#comment:3>
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