greatest common divisor implementation

bearophile bearophileHUGS at lycos.com
Mon Feb 7 12:26:45 PST 2011


Matthias Walter:

> 1. First thing I saw is that gcd(-3,6) raises an exception, although
> mathematically it is just 2. Of course checking the sign of the
> arguments takes computation time, but for my stuff I'd definitely need
> it. If it's really too expensive then there should be at least another
> routine.

I agree. I my code I have not used Phobos gcd() because of that.


> Any comments before I start working on it?

See also:
http://d.puremagic.com/issues/show_bug.cgi?id=4125

Bye,
bearophile


More information about the Digitalmars-d mailing list