gmp_libmpf_set_z Method |
Namespace: Math.Gmp.Native
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
// 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.