Click or drag to resize
gmp_libmpz_set_d 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_d(
	mpz_t rop,
	double op
)

Parameters

rop
Type: Math.Gmp.Nativempz_t
The destination integer.
op
Type: SystemDouble
The source integer.
Remarks

mpz_set_d truncate op to make it an 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 the truncation of 10.7.
gmp_lib.mpz_set_d(x, 10.7D);

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

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