gmp_libmpz_divexact Method |
Set q to n / d when it is known in advance that d divides n.
Namespace:
Math.Gmp.Native
Assembly:
Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax 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
Parameters
- q
- Type: Math.Gmp.Nativempz_t
The result quotient integer. - n
- Type: Math.Gmp.Nativempz_t
The numerator integer. - d
- Type: Math.Gmp.Nativempz_t
The denominator integer.
Examples
mpz_t x = new mpz_t();
gmp_lib.mpz_init_set_ui(x, 10000U);
mpz_t y = new mpz_t();
gmp_lib.mpz_init_set_ui(y, 5U);
mpz_t z = new mpz_t();
gmp_lib.mpz_init(z);
gmp_lib.mpz_divexact(z, x, y);
Assert.IsTrue(gmp_lib.mpz_get_si(z) == 2000);
gmp_lib.mpz_clears(x, y, z, null);
Dim x As New mpz_t()
gmp_lib.mpz_init_set_ui(x, 10000UI)
Dim y As New mpz_t()
gmp_lib.mpz_init_set_ui(y, 5UI)
Dim z As New mpz_t()
gmp_lib.mpz_init(z)
gmp_lib.mpz_divexact(z, x, y)
Assert.IsTrue(gmp_lib.mpz_get_si(z) = 2000)
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.
See Also