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