[Issue 4125] std.numeric.gcd can use a binary GCD

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Dec 9 07:46:15 PST 2016


https://issues.dlang.org/show_bug.cgi?id=4125

Alexandru Razvan Caciulescu <alexandru.razvan.c at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alexandru.razvan.c at gmail.co
                   |                            |m

--- Comment #7 from Alexandru Razvan Caciulescu <alexandru.razvan.c at gmail.com> ---
After conducting some benchmarks we arrived to the conclusion that currently
the dmd compiler works best with Euclid's algorithm for GCD, otherwise we use
Stein's algorithm for ldc or gdc.

I tested both the previously shared benchmarks on the forum and a couple of my
own  and noted that gcd_binary2 implemented by bearophile_hugs at eml.cc has the
best results, so I used that.

PR: https://github.com/dlang/phobos/pull/4940

--


More information about the Digitalmars-d-bugs mailing list