gmp_libmpz_tstbit Method |
Namespace: Math.Gmp.Native
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
The function behaves as if twos complement arithmetic were used (although sign-magnitude is the actual implementation). The least significant bit is number 0.
// Create, initialize, and set the value of rop to 70. mpz_t rop = new mpz_t(); gmp_lib.mpz_init_set_si(rop, 70); // Assert that bit 3 of rop is 0. Assert.IsTrue(gmp_lib.mpz_tstbit(rop, 3U) == 0); // Release unmanaged memory allocated for rop. gmp_lib.mpz_clear(rop);
' Create, initialize, and set the value of rop to 70. Dim rop As New mpz_t() gmp_lib.mpz_init_set_si(rop, 70) ' Assert that bit 3 of rop is 0. Assert.IsTrue(gmp_lib.mpz_tstbit(rop, 3UI) = 0) ' Release unmanaged memory allocated for rop. 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.