Closed GoogleCodeExporter closed 9 years ago
+1
By the way, gcd (and lcm?) could be sped up enormously for long lists of
arguments by
starting to look for the smallest numbers, although this may be hard to
implement
generically so it works both for numbers and polynomials.
Original comment by fredrik....@gmail.com
on 29 Feb 2008 at 10:42
The changes have been applied.
A simple test case or two would be nice.
Original comment by fredrik....@gmail.com
on 29 Feb 2008 at 10:52
Here are two simple tests.
p1 = poly([1, 2, 1])
p2 = poly([2, 3, 1])
q, r = divmod(gcd(p1, p2), poly([1,1]))
assert q.degree == 0 and not r
q, r = divmod(lcm(p1, p2), p1*poly([2,1]))
assert q.degree == 0 and not r
Original comment by mario.pe...@gmail.com
on 3 Mar 2008 at 10:46
Added. Thanks!
Original comment by fredrik....@gmail.com
on 3 Mar 2008 at 1:37
Original issue reported on code.google.com by
mario.pe...@gmail.com
on 29 Feb 2008 at 10:29