[]
        
(Showing Draft Content)

CSJ2K.j2k.util.MathUtil.gcd

gcd Method

gcd(int, int)

Method that calculates the Greatest Common Divisor (GCD) of two positive integer numbers.

Declaration
public static int gcd(int x1, int x2)
Parameters
Type Name Description
int x1
int x2
Returns
Type Description
int

gcd(int[])

Method that calculates the Greatest Common Divisor (GCD) of several positive integer numbers.

Declaration
public static int gcd(int[] x)
Parameters
Type Name Description
int[] x

Array containing the numbers.

Returns
Type Description
int