posts - 19 , comments - 8 , trackbacks - 0

greatest common divisor

Evaluating the Greatest Common Divisor function in C#
Available Routines There are a number of basic routines. Two that are attributable to Euclid are the subtraction and modulus method. There is another routine be Stein which uses binary arithmatic. Lastly there is the "trial and error" version which is useful as a check on validity. The algorithms The algorithms are provided in the code below. using System; namespace JetBlack.Common { public static class GreatestCommonDivisor { public enum Algorithm { TrialAndError, EuclidModulus, EuclidModulusShort, ......

Posted On Friday, November 14, 2014 10:56 AM | Comments (0) | Filed Under [ C# GCD greatest common divisor ]

Powered by: