Click or drag to resize
gmp_libmpz_get_ui Method
Return the value of op as an unsigned long.

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 uint mpz_get_ui(
	mpz_t op
)

Parameters

op
Type: Math.Gmp.Nativempz_t
The integer.

Return Value

Type: UInt32
The value of op as an unsigned long.
Remarks

If op is too big to fit an unsigned long then just the least significant bits that do fit are returned. The sign of op is ignored, only the absolute value is used.

Examples
// Create, initialize, and set the value of x to 10.
mpz_t x = new mpz_t();
gmp_lib.mpz_init_set_ui(x, 10U);

// Retrieve the value of x, and assert that it is 10.
Assert.IsTrue(gmp_lib.mpz_get_ui(x) == 10U);

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