Click or drag to resize
gmp_libmpf_set 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 mpf_set(
	mpf_t rop,
	mpf_t op
)

Parameters

rop
Type: Math.Gmp.Nativempf_t
The result float.
op
Type: Math.Gmp.Nativempf_t
The operand.
Examples
// Create, initialize, and set a new floating-point number x to 10.
mpf_t x = new mpf_t();
gmp_lib.mpf_init2(x, 128U);
gmp_lib.mpf_set_si(x, 10);

// Create, initialize, and set a new floating-point number y to -210.
mpf_t y = new mpf_t();
gmp_lib.mpf_init2(y, 128U);
gmp_lib.mpf_set_si(y, -210);

// Assign the value of y to x.
gmp_lib.mpf_set(x, y);

// Assert that the value of x is -210.
Assert.IsTrue(gmp_lib.mpf_get_d(x) == -210.0);

// Release unmanaged memory allocated for x and y.
gmp_lib.mpf_clears(x, y, null);
See Also