gmp_libmpz_fdiv_q_2exp Method |
Set the quotient q to floor(n / 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 void mpz_fdiv_q_2exp(
mpz_t q,
mpz_t n,
mp_bitcnt_t b
)
Public Shared Sub mpz_fdiv_q_2exp (
q As mpz_t,
n As mpz_t,
b As mp_bitcnt_t
)
public:
static void mpz_fdiv_q_2exp(
mpz_t^ q,
mpz_t^ n,
mp_bitcnt_t b
)
static member mpz_fdiv_q_2exp :
q : mpz_t *
n : mpz_t *
b : mp_bitcnt_t -> unit
Parameters
- q
- Type: Math.Gmp.Nativempz_t
The result quotient integer. - n
- Type: Math.Gmp.Nativempz_t
The numerator integer. - b
- Type: Math.Gmp.Nativemp_bitcnt_t
The exponent of the power of two denominator.
Examples
mpz_t n = new mpz_t();
gmp_lib.mpz_init_set_si(n, 10001);
mpz_t q = new mpz_t();
gmp_lib.mpz_init(q);
gmp_lib.mpz_fdiv_q_2exp(q, n, 2U);
Assert.IsTrue(gmp_lib.mpz_get_si(q) == 2500);
gmp_lib.mpz_clears(n, q, null);
Dim n As New mpz_t()
gmp_lib.mpz_init_set_si(n, 10001)
Dim q As New mpz_t()
gmp_lib.mpz_init(q)
gmp_lib.mpz_fdiv_q_2exp(q, n, 2UI)
Assert.IsTrue(gmp_lib.mpz_get_si(q) = 2500)
gmp_lib.mpz_clears(n, q, 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