Created
          September 30, 2013 14:21 
        
      - 
      
- 
        Save wtarr/6764547 to your computer and use it in GitHub Desktop. 
    Greatest Common denominator 
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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