gmp_libmpz_congruent_2exp_p Method |
Return non-zero if n is congruent to c modulo 2^b.
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_congruent_2exp_p(
mpz_t n,
mpz_t c,
mp_bitcnt_t b
)
Public Shared Function mpz_congruent_2exp_p (
n As mpz_t,
c As mpz_t,
b As mp_bitcnt_t
) As Integer
public:
static int mpz_congruent_2exp_p(
mpz_t^ n,
mpz_t^ c,
mp_bitcnt_t b
)
static member mpz_congruent_2exp_p :
n : mpz_t *
c : mpz_t *
b : mp_bitcnt_t -> int
Parameters
- n
- Type: Math.Gmp.Nativempz_t
An operand integer. - c
- Type: Math.Gmp.Nativempz_t
The remainder of the division by 2^b. - b
- Type: Math.Gmp.Nativemp_bitcnt_t
The exponent of the power of two divisor.
Return Value
Type:
Int32Non-zero if
n is congruent to
c modulo 2^
b.
Remarks n is congruent to c mod 2^b if there exists an integer q
satisfying n = c + q * 2^b.
Examples
mpz_t n = new mpz_t();
gmp_lib.mpz_init_set_ui(n, 10001U);
mpz_t c = new mpz_t();
gmp_lib.mpz_init_set_ui(c, 1U);
Assert.IsTrue(gmp_lib.mpz_congruent_2exp_p(n, c, 3U) > 0);
gmp_lib.mpz_clears(n, c, null);
Dim n As New mpz_t()
gmp_lib.mpz_init_set_ui(n, 10001UI)
Dim c As New mpz_t()
gmp_lib.mpz_init_set_ui(c, 1UI)
Assert.IsTrue(gmp_lib.mpz_congruent_2exp_p(n, c, 3UI) > 0)
gmp_lib.mpz_clears(n, c, 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