[Issue 7102] std.numeric.gcd with BigInts too

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 13 10:02:30 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=7102


bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


--- Comment #2 from bearophile_hugs at eml.cc 2011-12-13 10:02:29 PST ---
(In reply to comment #1)
> There are a few interesting issues here:
> 
> Firstly, GCD for bigints is an important primitive operation, but it's very
> complicated (the sub-quadratic algorithms are highly non-trivial). It's
> completely different to algorithms used for built-in types (where the cost of
> arithmetic is independent of the magnitude of the integer). So it can't
> sensibly be made generic.
> 
> Secondly, Euclid's algorithm is always inferior to the binary GCD algorithm,
> whenever the latter applies. The generic version should be using binary GCD.
> 
> Finally, it's Euclid's algorithm, not Eulers!

So this code is useless... Thank you for your comments, Don.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list