Skip to content

Instantly share code, notes, and snippets.

@wtarr
Created September 30, 2013 14:21
Show Gist options
  • Save wtarr/6764547 to your computer and use it in GitHub Desktop.
Save wtarr/6764547 to your computer and use it in GitHub Desktop.
Greatest Common denominator
private float GreatestCommonDenominator(float a, float b)
{
// http://en.wikipedia.org/wiki/Euclidean_algorithm
if (b == 0)
{
return a;
}
return GreatestCommonDenominator(b, a%b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment