Returns the greatest common divisor of two integers
using the extended Euclidean algorithm.
Namespace:
Extreme.Mathematics
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static short GreatestCommonDivisor(
short a,
short b,
out short x,
out short y
)
Public Shared Function GreatestCommonDivisor (
a As Short,
b As Short,
<OutAttribute> ByRef x As Short,
<OutAttribute> ByRef y As Short
) As Short
public:
static short GreatestCommonDivisor(
short a,
short b,
[OutAttribute] short% x,
[OutAttribute] short% y
)
static member GreatestCommonDivisor :
a : int16 *
b : int16 *
x : int16 byref *
y : int16 byref -> int16
Parameters
- a
- Type: SystemInt16
An integer. - b
- Type: SystemInt16
An integer. - x
- Type: SystemInt16
On return, the coefficient of a. - y
- Type: SystemInt16
On return, the coefficient of b.
Return Value
Type:
Int16The greatest common divisor of
a
and
b.
The coefficients x and y
are such that
xa+yb=gcd(a,b).
Reference