Click or drag to resize
gmp_libmpz_bin_uiui Method
Compute the binomial coefficient n over k and store the result in rop.

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 void mpz_bin_uiui(
	mpz_t rop,
	uint n,
	uint k
)

Parameters

rop
Type: Math.Gmp.Nativempz_t
The result integer.
n
Type: SystemUInt32
The first operand integer.
k
Type: SystemUInt32
The second operand integer.
Examples
// Create, initialize, and set the value of rop to 0.
mpz_t rop = new mpz_t();
gmp_lib.mpz_init(rop);

// Set rop to the binomial coefficient (4:2).
gmp_lib.mpz_bin_uiui(rop, 4U, 2U);

// Assert that rop is 6.
Assert.IsTrue(gmp_lib.mpz_get_si(rop) == 6);

// Release unmanaged memory allocated for rop.
gmp_lib.mpz_clear(rop);
See Also