gmp_lib.mpz_set_ui Method

GMP Native Interface for .NET

gmp_libmpz_set_ui Method
Set the value of rop from op.

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

Parameters

rop
Type: Math.Gmp.Nativempz_t
The destination integer.
op
Type: SystemUInt32
The source integer.
Examples
// Create and initialize a new integer x.
mpz_t x = new mpz_t();
gmp_lib.mpz_init(x);

// Set the value of x to 10.
gmp_lib.mpz_set_ui(x, 10U);

// Assert that the value of x is 10.
Assert.IsTrue(gmp_lib.mpz_get_ui(x) == 10U);

// Release unmanaged memory allocated for x.
gmp_lib.mpz_clear(x);
' Create and initialize a new integer x.
Dim x As New mpz_t()

gmp_lib.mpz_init(x)

' Set the value of x to 10.
gmp_lib.mpz_set_ui(x, 10UI)

' Assert that the value of x is 10.
Assert.IsTrue(gmp_lib.mpz_get_ui(x) = 10UI)

' 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