gmp_lib.mpn_gcd_1 Method

GMP Native Interface for .NET

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
)
Public Shared Function mpn_gcd_1 ( 
	xp As mp_ptr,
	xn As mp_size_t,
	ylimb As mp_limb_t
) As mp_limb_t
public:
static mp_limb_t mpn_gcd_1(
	mp_ptr^ xp, 
	mp_size_t xn, 
	mp_limb_t ylimb
)
static member mpn_gcd_1 : 
        xp : mp_ptr * 
        xn : mp_size_t * 
        ylimb : mp_limb_t -> mp_limb_t 

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);
' Create multi-precision operand.
Dim xp As New mp_ptr(New UInteger() { &H0, &H1})

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

' Release unmanaged memory.
gmp_lib.free(xp)

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

See Also