Click or drag to resize
gmp_libmpq_init Method
Initialize x and set it to 0/1.

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 mpq_init(
	mpq_t x
)

Parameters

x
Type: Math.Gmp.Nativempq_t
The operand rational.
Remarks

Each variable should normally only be initialized once, or at least cleared out (using the function mpq_clear) between each initialization.

Examples
// Create and initialize a new rational x.
mpq_t x = new mpq_t();
gmp_lib.mpq_init(x);

// Assert that the value of x is 0.
char_ptr s = gmp_lib.mpq_get_str(char_ptr.Zero, 10, x);
Assert.IsTrue(s.ToString() == "0");

// Release unmanaged memory allocated for x and its string value.
gmp_lib.mpq_clear(x);
gmp_lib.free(s);
See Also