gmp_libmpz_divisible_p Method |
Return non-zero if n is exactly divisible by 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 int mpz_divisible_p(
mpz_t n,
mpz_t d
)
Public Shared Function mpz_divisible_p (
n As mpz_t,
d As mpz_t
) As Integer
public:
static int mpz_divisible_p(
mpz_t^ n,
mpz_t^ d
)
static member mpz_divisible_p :
n : mpz_t *
d : mpz_t -> int
Parameters
- n
- Type: Math.Gmp.Nativempz_t
The numerator integer. - d
- Type: Math.Gmp.Nativempz_t
The denominator integer.
Return Value
Type:
Int32Non-zero if
n is exactly divisible by
d.
Remarks n is divisible by d if there exists an integer q
satisfying n = q * d. Unlike the other division functions,
d = 0 is accepted and following the rule it can be seen that only 0 is
considered divisible by 0.
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);
Assert.IsTrue(gmp_lib.mpz_divisible_p(x, y) > 0);
gmp_lib.mpz_clears(x, y, 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)
Assert.IsTrue(gmp_lib.mpz_divisible_p(x, y) > 0)
gmp_lib.mpz_clears(x, y, 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