gmp_lib.mpf_set Method

GMP Native Interface for .NET

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
)
Public Shared Sub mpf_set ( 
	rop As mpf_t,
	op As mpf_t
)
public:
static void mpf_set(
	mpf_t^ rop, 
	mpf_t^ op
)
static member mpf_set : 
        rop : mpf_t * 
        op : mpf_t -> unit 

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);
' Create, initialize, and set a new floating-point number x to 10.
Dim x As New mpf_t()
gmp_lib.mpf_init2(x, 128UI)
gmp_lib.mpf_set_si(x, 10)

' Create, initialize, and set a new floating-point number y to -210.
Dim y As New mpf_t()
gmp_lib.mpf_init2(y, 128UI)
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, Nothing)

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

See Also