gmp_lib.mpz_add_ui Method

GMP Native Interface for .NET

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
)
Public Shared Sub mpz_add_ui ( 
	rop As mpz_t,
	op1 As mpz_t,
	op2 As UInteger
)
public:
static void mpz_add_ui(
	mpz_t^ rop, 
	mpz_t^ op1, 
	unsigned int op2
)
static member mpz_add_ui : 
        rop : mpz_t * 
        op1 : mpz_t * 
        op2 : uint32 -> unit 

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);
' Create, initialize, and set the value of x to 0.
Dim x As New mpz_t()
gmp_lib.mpz_init(x)

' Increment x twice by 101999.
gmp_lib.mpz_add_ui(x, x, 101999UI)
gmp_lib.mpz_add_ui(x, x, 101999UI)

' Assert that x is 203998.
Assert.IsTrue(gmp_lib.mpz_get_ui(x) = 203998UI)

' Release unmanaged memory allocated for x.
gmp_lib.mpz_clear(x)

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