Click or drag to resize
gmp_libmpz_add_ui 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_add_ui(
	mpz_t rop,
	mpz_t op1,
	uint op2
)

Parameters

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

// Increment x twice by 101999.
gmp_lib.mpz_add_ui(x, x, 101999U);
gmp_lib.mpz_add_ui(x, x, 101999U);

// Assert that x is 203998.
Assert.IsTrue(gmp_lib.mpz_get_ui(x) == 203998U);

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