gmp_lib.mpf_set_z Method

GMP Native Interface for .NET

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

Parameters

rop
Type: Math.Gmp.Nativempf_t
The result float.
op
Type: Math.Gmp.Nativempz_t
The operand.
Examples
// Create, initialize, and set a new integer y to 200.
mpz_t y = new mpz_t();
gmp_lib.mpz_init(y);
gmp_lib.mpz_set_ui(y, 200U);

// Create, initialize, and set a new floating-point number x to y.
mpf_t x = new mpf_t();
gmp_lib.mpf_init(x);
gmp_lib.mpf_set_z(x, y);

// Assert that x is 200.
Assert.IsTrue(x.ToString() == "0.2e3");

// Release unmanaged memory allocated for x and y.
gmp_lib.mpf_clear(x);
gmp_lib.mpz_clear(y);
' Create, initialize, and set a new integer y to 200.
Dim y As New mpz_t()
gmp_lib.mpz_init(y)
gmp_lib.mpz_set_ui(y, 200UI)

' Create, initialize, and set a new floating-point number x to y.
Dim x As New mpf_t()
gmp_lib.mpf_init(x)
gmp_lib.mpf_set_z(x, y)

' Assert that x is 200.
Assert.IsTrue(x.ToString() = "0.2e3")

' Release unmanaged memory allocated for x and y.
gmp_lib.mpf_clear(x)
gmp_lib.mpz_clear(y)

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