#10484: Chinese remainder code raises an error when called with Python ints
-----------------------------+----------------------------------------------
Reporter: davidloeffler | Owner: was
Type: defect | Status: new
Priority: major | Milestone: sage-4.6.2
Component: number theory | Keywords: CRT
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
Lots of the congruence subgroup code works intensively with small
integers, and represents these as Python ints rather than Sage integers
for speed reasons. This brought to light the following irritating bug:
{{{
sage: crt(int(2), int(3), int(5), int(7))
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
/storage/masiao/sage-4.6.1.alpha3/devel/sage-reviewing/<ipython console>
in <module>()
/usr/local/sage/sage-4.6/local/lib/python2.6/site-
packages/sage/rings/arith.pyc in crt(a, b, m, n)
2737 return CRT_list(a, b)
2738 g, alpha, beta = XGCD(m, n)
-> 2739 q, r = (b - a).quo_rem(g)
2740 if r != 0:
2741 raise ValueError("No solution to crt problem since
gcd(%s,%s) does not divide %s-%s" % (m, n, a, b))
AttributeError: 'int' object has no attribute 'quo_rem'
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10484>
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.