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)
Public Shared Function gcd(x1 As Integer, x2 As Integer) As Integer
Parameters
| Type |
Name |
Description |
| int |
x1 |
|
| int |
x2 |
|
Returns
gcd(int[])
Method that calculates the Greatest Common Divisor (GCD) of several
positive integer numbers.
Declaration
public static int gcd(int[] x)
Public Shared Function gcd(x As Integer()) As Integer
Parameters
| Type |
Name |
Description |
| int[] |
x |
Array containing the numbers.
|
Returns