Click or drag to resize
gmp_libmpz_divisible_2exp_p Method
Return non-zero if n is exactly divisible by 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_divisible_2exp_p(
	mpz_t n,
	mp_bitcnt_t b
)

Parameters

n
Type: Math.Gmp.Nativempz_t
The numerator integer.
b
Type: Math.Gmp.Nativemp_bitcnt_t
The exponent of the power of two denominator integer.

Return Value

Type: Int32
Non-zero if n is exactly divisible by 2^b.
Remarks

n is divisible by 2^b if there exists an integer q satisfying n = q * 2^b.

Examples
// Create, initialize, and set the value of x to 10000.
mpz_t x = new mpz_t();
gmp_lib.mpz_init_set_ui(x, 10000U);

Assert.IsTrue(gmp_lib.mpz_divisible_2exp_p(x, 2U) > 0);

// Release unmanaged memory allocated for x.
gmp_lib.mpz_clear(x);
See Also