www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12557] New: std.numeric.gcd documentation reports Euler's


          Issue ID: 12557
           Summary: std.numeric.gcd documentation reports Euler's
                    algorithm, but it uses Euclid's algorithm
           Product: D
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: bert e.co.za

The documentation for std.numeric.gcd in
http://dlang.org/phobos/std_numeric.html says:
"Computes the greatest common divisor of a and b by using Euler's algorithm."

but looking at the code (where the comment also obviously comes from to
generate the documentation page):

it seems to me to use Euclid's algorithm:

I also couldn't really find any references to a formula for greatest common
divisor devised by Euler.

The fix is thus just to replace Euler with Euclid in the comment of the gcd

(I "reported" this on twitter too, but it consequently dawned on me that is not
the correct route.
https://twitter.com/epigamiq/status/454191037742059520 )

Apr 10 2014