Set the remainder r to n - q * d where q = trunc(n / d).
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_tdiv_r(
mpz_t r,
mpz_t n,
mpz_t d
)
Public Shared Sub mpz_tdiv_r (
r As mpz_t,
n As mpz_t,
d As mpz_t
)
public:
static void mpz_tdiv_r(
mpz_t^ r,
mpz_t^ n,
mpz_t^ d
)
static member mpz_tdiv_r :
r : mpz_t *
n : mpz_t *
d : mpz_t -> unit
Parameters
- r
- Type: Math.Gmp.Nativempz_t
The result remainder integer. - n
- Type: Math.Gmp.Nativempz_t
The numerator integer. - d
- Type: Math.Gmp.Nativempz_t
The denominator integer.
Examples
mpz_t n = new mpz_t();
gmp_lib.mpz_init_set_si(n, 10000);
mpz_t d = new mpz_t();
gmp_lib.mpz_init_set_si(d, 3);
mpz_t r = new mpz_t();
gmp_lib.mpz_init(r);
gmp_lib.mpz_tdiv_r(r, n, d);
Assert.IsTrue(gmp_lib.mpz_get_si(r) == 1);
gmp_lib.mpz_clears(n, d, r, null);
Dim n As New mpz_t()
gmp_lib.mpz_init_set_si(n, 10000)
Dim d As New mpz_t()
gmp_lib.mpz_init_set_si(d, 3)
Dim r As New mpz_t()
gmp_lib.mpz_init(r)
gmp_lib.mpz_tdiv_r(r, n, d)
Assert.IsTrue(gmp_lib.mpz_get_si(r) = 1)
gmp_lib.mpz_clears(n, d, 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.
See Also