Click or drag to resize
gmp_libmpz_ui_sub Method
Set rop to op1 - op2.

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_ui_sub(
	mpz_t rop,
	uint op1,
	mpz_t op2
)

Parameters

rop
Type: Math.Gmp.Nativempz_t
The result integer.
op1
Type: SystemUInt32
The first operand integer.
op2
Type: Math.Gmp.Nativempz_t
The second operand integer.
Examples
// Create, initialize, and set the value of x to 10000.
mpz_t x = new mpz_t();
gmp_lib.mpz_init_set_ui(x, 10000U);

// Create, initialize, and set the value of z to 0.
mpz_t z = new mpz_t();
gmp_lib.mpz_init(z);

// Set z = 12222 - x.
gmp_lib.mpz_ui_sub(z, 12222U, x);

// Assert that z = 12222 - x.
Assert.IsTrue(gmp_lib.mpz_get_si(z) == 2222);

// Release unmanaged memory allocated for x and z.
gmp_lib.mpz_clears(x, z, null);
See Also