Test bit bit_index in op and return 0 or 1 accordingly.
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_tstbit(
mpz_t op,
mp_bitcnt_t bit_index
)
Public Shared Function mpz_tstbit (
op As mpz_t,
bit_index As mp_bitcnt_t
) As Integer
public:
static int mpz_tstbit(
mpz_t^ op,
mp_bitcnt_t bit_index
)
static member mpz_tstbit :
op : mpz_t *
bit_index : mp_bitcnt_t -> int
Parameters
- op
- Type: Math.Gmp.Nativempz_t
- bit_index
- Type: Math.Gmp.Nativemp_bitcnt_t
Return Value
Type:
Int32Test bit
bit_index in
op and return
0 or
1 accordingly.
Remarks
The function behaves as if twos complement arithmetic were used (although sign-magnitude is the actual implementation).
The least significant bit is number 0.
Examples
mpz_t rop = new mpz_t();
gmp_lib.mpz_init_set_si(rop, 70);
Assert.IsTrue(gmp_lib.mpz_tstbit(rop, 3U) == 0);
gmp_lib.mpz_clear(rop);
Dim rop As New mpz_t()
gmp_lib.mpz_init_set_si(rop, 70)
Assert.IsTrue(gmp_lib.mpz_tstbit(rop, 3UI) = 0)
gmp_lib.mpz_clear(rop)
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