gmp_libmpz_fdiv_q Method |
Namespace: Math.Gmp.Native
public static void mpz_fdiv_q( mpz_t q, mpz_t n, mpz_t d )
Public Shared Sub mpz_fdiv_q ( q As mpz_t, n As mpz_t, d As mpz_t )
public: static void mpz_fdiv_q( mpz_t^ q, mpz_t^ n, mpz_t^ d )
static member mpz_fdiv_q : q : mpz_t * n : mpz_t * d : mpz_t -> unit
// Create, initialize, and set the value of n to 10000. mpz_t n = new mpz_t(); gmp_lib.mpz_init_set_si(n, 10000); // Create, initialize, and set the value of d to 3. mpz_t d = new mpz_t(); gmp_lib.mpz_init_set_si(d, 3); // Create, initialize, and set the value of q to 0. mpz_t q = new mpz_t(); gmp_lib.mpz_init(q); // Set q = floor(n / d). gmp_lib.mpz_fdiv_q(q, n, d); // Assert that q is floor(10000 / 3). Assert.IsTrue(gmp_lib.mpz_get_si(q) == 3333); // Release unmanaged memory allocated for n, d, and q. gmp_lib.mpz_clears(n, d, q, null);
' Create, initialize, and set the value of n to 10000. Dim n As New mpz_t() gmp_lib.mpz_init_set_si(n, 10000) ' Create, initialize, and set the value of d to 3. Dim d As New mpz_t() gmp_lib.mpz_init_set_si(d, 3) ' Create, initialize, and set the value of q to 0. Dim q As New mpz_t() gmp_lib.mpz_init(q) ' Set q = floor(n / d). gmp_lib.mpz_fdiv_q(q, n, d) ' Assert that q is floor(10000 / 3). Assert.IsTrue(gmp_lib.mpz_get_si(q) = 3333) ' Release unmanaged memory allocated for n, d, and q. gmp_lib.mpz_clears(n, d, q, 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.