#8378: [trivial to fix] typo in documentation of crt
--------------------------------+-------------------------------------------
Reporter: zimmerma | Owner: AlexGhitza
Type: defect | Status: needs_work
Priority: trivial | Milestone: sage-4.4
Component: basic arithmetic | Keywords:
Author: Paul Zimmermann | Upstream: N/A
Reviewer: John Cremona | Merged:
Work_issues: |
--------------------------------+-------------------------------------------
Comment(by zimmerma):
John,
> Or you could ask me to do it since I'm the one who has made
difficulties!
please go ahead! By the way, I noticed this while writing a textbook in
french about Sage.
The textbook currently proposes a function {{{mycrt}}} which implements
the general case:
{{{
def mycrt(a,b,m,n):
g = gcd(m,n)
x0 = a % g
y0 = b % g
if x0 <> y0:
raise ValueError, "no solution"
return (x0 + g * crt((a-x0)//g,(b-x0)//g,m//g,n//g)) % (n*m//g)
sage: mycrt(15,1,30,4)
45
sage: mycrt(15,2,30,4)
Traceback (most recent call last):
...
ValueError: no solution
}}}
If you implement the general case, I will need to revise the textbook, but
this is not a
problem... I will be happy to review your patch, but maybe a separate
ticket is needed,
otherwise we would both appear as author+reviewer, and I'm not sure the
release manager
will be happy with that.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8378#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.