#10217: bug in rings/fast_arith.pyx
--------------------------------+-------------------------------------------
   Reporter:  was               |       Owner:  AlexGhitza
       Type:  defect            |      Status:  new       
   Priority:  minor             |   Milestone:  sage-4.6.1
  Component:  basic arithmetic  |    Keywords:            
     Author:                    |    Upstream:  N/A       
   Reviewer:                    |      Merged:            
Work_issues:                    |  
--------------------------------+-------------------------------------------
 This chunk of code in fast_arith.pyx:
 {{{

     cdef public long long c_inverse_mod_longlong(self, long long a, long
 long m) except -1:
         cdef long long g, s, t
         g = self.c_xgcd_longlong(a,m, &s, &t)
         s = s % m
         if s < 0:
             s = s + m
         return s
 }}}
 should raise an exception if g != 1, so should be
 {{{

     cdef public long long c_inverse_mod_longlong(self, long long a, long
 long m) except -1:
         cdef long long g, s, t
         g = self.c_xgcd_longlong(a,m, &s, &t)
         if g != 1: raise ZeroDivisionError
         s = s % m
         if s < 0:
             s = s + m
         return s
 }}}

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