Click or drag to resize
gmp_libmpn_gcd_1 Method
Return the greatest common divisor of {xp, xn} and ylimb.

Namespace:  Math.Gmp.Native
Assembly:  Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static mp_limb_t mpn_gcd_1(
	mp_ptr xp,
	mp_size_t xn,
	mp_limb_t ylimb
)

Parameters

xp
Type: Math.Gmp.Nativemp_ptr
The first operand integer.
xn
Type: Math.Gmp.Nativemp_size_t
The number of limbs of xp.
ylimb
Type: Math.Gmp.Nativemp_limb_t
The second operand integer.

Return Value

Type: mp_limb_t
The greatest common divisor of {xp, xn} and ylimb.
Remarks

Both operands must be non-zero.

Examples
// Create multi-precision operand.
mp_ptr xp = new mp_ptr(new uint[] { 0x00000000, 0x00000001 });

// Assert result of operation.
Assert.IsTrue(gmp_lib.mpn_gcd_1(xp, xp.Size, 1073741824) == 1073741824);

// Release unmanaged memory.
gmp_lib.free(xp);
See Also