Click or drag to resize
gmp_libmpz_inits Method
Initialize a NULL-terminated list of mpz_t variables, and set their values to 0.

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_inits(
	params mpz_t[] x
)

Parameters

x
Type: Math.Gmp.Nativempz_t
A NULL-terminated list of mpz_t variables.
Examples
// Create new integers x1, x2 and x3.
mpz_t x1 = new mpz_t();
mpz_t x2 = new mpz_t();
mpz_t x3 = new mpz_t();

// Initialize the integers.
gmp_lib.mpz_inits(x1, x2, x3, null);

// Assert that their value is 0.
Assert.IsTrue(gmp_lib.mpz_get_si(x1) == 0);
Assert.IsTrue(gmp_lib.mpz_get_si(x2) == 0);
Assert.IsTrue(gmp_lib.mpz_get_si(x3) == 0);

// Release unmanaged memory allocated for the integers.
gmp_lib.mpz_clears(x1, x2, x3, null);
See Also