#10217: bug in rings/fast_arith.pyx
-----------------------------------------------+----------------------------
Reporter: was | Owner: AlexGhitza
Type: defect | Status: needs_work
Priority: minor | Milestone: sage-5.0
Component: basic arithmetic | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Mike Hansen, Andre Apitzsch | Merged in:
Dependencies: | Stopgaps:
-----------------------------------------------+----------------------------
Changes (by jdemeyer):
* status: positive_review => needs_work
Old description:
> 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
> }}}
>
> '''Apply''' attachment:trac_10217_merged.patch
New description:
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
}}}
'''Apply''' attachment:trac_10217_merged.patch
--
Comment:
This should be rebased to sage-5.0.beta12:
{{{
applying trac_10217_merged.patch
patching file sage/ext/multi_modular.pyx
Hunk #1 FAILED at 156
1 out of 2 hunks FAILED -- saving rejects to file
sage/ext/multi_modular.pyx.rej
patch failed, unable to continue (try -v)
patch failed, rejects left in working dir
errors during apply, please fix and refresh trac_10217_merged.patch
}}}
Also the Reviewer field needs to be filled in.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10217#comment:9>
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.