Merge branch 'documentation/JAL-3407_2.11.1_release' into releases/Release_2_11_1_Branch
[jalview.git] / src / jalview / util / MathUtils.java
1 package jalview.util;
2
3 public class MathUtils
4 {
5
6   /**
7    * Returns the greatest common divisor of two integers
8    * 
9    * @param a
10    * @param b
11    * @return
12    */
13   public static int gcd(int a, int b)
14   {
15     if (b == 0)
16     {
17       return Math.abs(a);
18     }
19     return gcd(b, a % b);
20   }
21
22 }