gmp_libmpz_mul_2exp Method |
Set rop to op1 * 2^op2.
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_mul_2exp(
mpz_t rop,
mpz_t op1,
mp_bitcnt_t op2
)
Public Shared Sub mpz_mul_2exp (
rop As mpz_t,
op1 As mpz_t,
op2 As mp_bitcnt_t
)
public:
static void mpz_mul_2exp(
mpz_t^ rop,
mpz_t^ op1,
mp_bitcnt_t op2
)
static member mpz_mul_2exp :
rop : mpz_t *
op1 : mpz_t *
op2 : mp_bitcnt_t -> unit
Parameters
- rop
- Type: Math.Gmp.Nativempz_t
The result integer. - op1
- Type: Math.Gmp.Nativempz_t
The first operand integer. - op2
- Type: Math.Gmp.Nativemp_bitcnt_t
The second operand integer.
Remarks
This operation can also be defined as a left shift by op2 bits.
Examples
mpz_t x = new mpz_t();
gmp_lib.mpz_init_set_si(x, -10000);
mpz_t z = new mpz_t();
gmp_lib.mpz_init(z);
gmp_lib.mpz_mul_2exp(z, x, 2U);
Assert.IsTrue(gmp_lib.mpz_get_si(z) == -10000 * 4);
gmp_lib.mpz_clears(x, z, null);
Dim x As New mpz_t()
gmp_lib.mpz_init_set_si(x, -10000)
Dim z As New mpz_t()
gmp_lib.mpz_init(z)
gmp_lib.mpz_mul_2exp(z, x, 2UI)
Assert.IsTrue(gmp_lib.mpz_get_si(z) = -10000 * 4)
gmp_lib.mpz_clears(x, z, 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