Click here to Skip to main content
15,902,198 members
Articles / General Programming / Algorithms

Fast Greatest Common Divisor (GCD) Algorithm

Rate me:
Please Sign up or sign in to vote.
4.50/5 (2 votes)
11 Feb 2011CPOL 8K   1  
Can we simplify it by: (This essentially passes only two numbers). public int GCD(int value1, int value2){ int max = 0; bool gcdFound = false; int counter = 1; //Make sure both numbers are atleast 2 or above if (( value1 <= 1 ) || (value2 <= 1)) return...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions