git://source.jalview.org
/
jalview.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
72d46a251aedf2faee0be8567012536f77b0f0f6
[jalview.git]
/
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
}