gmp_libmpz_set_f Method |
Namespace: Math.Gmp.Native
public static void mpz_set_f( mpz_t rop, mpf_t op )
Public Shared Sub mpz_set_f ( rop As mpz_t, op As mpf_t )
public: static void mpz_set_f( mpz_t^ rop, mpf_t^ op )
static member mpz_set_f : rop : mpz_t * op : mpf_t -> unit
mpz_set_f truncate op to make it an integer.
// Create and initialize new integer x, and float y. mpz_t x = new mpz_t(); gmp_lib.mpz_init(x); mpf_t y = "1.7007e3"; // Set the value of x to the truncation of 1700.7. gmp_lib.mpz_set_f(x, y); // Assert that the value of x is 1700. Assert.IsTrue(gmp_lib.mpz_get_si(x) == 1700); // Release unmanaged memory allocated for x and y. gmp_lib.mpz_clear(x); gmp_lib.mpf_clear(y);
' Create and initialize new integer x, and float y. Dim x As New mpz_t() gmp_lib.mpz_init(x) Dim y As mpf_t = "1.7007e3" ' Set the value of x to the truncation of 1700.7. gmp_lib.mpz_set_f(x, y) ' Assert that the value of x is 1700. Assert.IsTrue(gmp_lib.mpz_get_si(x) = 1700) ' Release unmanaged memory allocated for x and y. gmp_lib.mpz_clear(x) gmp_lib.mpf_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.