gmp_libmpz_fdiv_r_ui Method |
Namespace: Math.Gmp.Native
public static uint mpz_fdiv_r_ui( mpz_t r, mpz_t n, uint d )
Public Shared Function mpz_fdiv_r_ui ( r As mpz_t, n As mpz_t, d As UInteger ) As UInteger
public: static unsigned int mpz_fdiv_r_ui( mpz_t^ r, mpz_t^ n, unsigned int d )
static member mpz_fdiv_r_ui : r : mpz_t * n : mpz_t * d : uint32 -> uint32
// 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 r to 0. mpz_t r = new mpz_t(); gmp_lib.mpz_init(r); // Set r = n - 3 * floor(n / 3), and return |r|. Assert.IsTrue(gmp_lib.mpz_fdiv_r_ui(r, n, 3U) == 1U); // Assert that r is 1. Assert.IsTrue(gmp_lib.mpz_get_si(r) == 1); // Release unmanaged memory allocated for n and r. gmp_lib.mpz_clears(n, r, 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 r to 0. Dim r As New mpz_t() gmp_lib.mpz_init(r) ' Set r = n - 3 * floor(n / 3), and return |r|. Set r = n - 3 * floor(n / 3), and return |r|. Assert.IsTrue(gmp_lib.mpz_fdiv_r_ui(r, n, 3UI) = 1UI) ' Assert that r is 1. Assert.IsTrue(gmp_lib.mpz_get_si(r) = 1) ' Release unmanaged memory allocated for n and r. gmp_lib.mpz_clears(n, r, 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.