Return the size of op measured in number of limbs.
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 mp_size_t mpz_size(
mpz_t op
)
Public Shared Function mpz_size (
op As mpz_t
) As mp_size_t
public:
static mp_size_t mpz_size(
mpz_t^ op
)
static member mpz_size :
op : mpz_t -> mp_size_t
Parameters
- op
- Type: Math.Gmp.Nativempz_t
The operand integer.
Return Value
Type:
mp_size_tThe size of
op measured in number of limbs.
Remarks
If op is zero, the returned value will be zero.
Examples
mpz_t op = new mpz_t();
char_ptr value = new char_ptr("1000 ABCD 1234 7AB8 24FD");
gmp_lib.mpz_init_set_str(op, value, 16);
if (gmp_lib.mp_bytes_per_limb == 4)
Assert.IsTrue(gmp_lib.mpz_size(op) == 3);
else
Assert.IsTrue(gmp_lib.mpz_size(op) == 2);
gmp_lib.mpz_clear(op);
gmp_lib.free(value);
Dim op As New mpz_t()
Dim value As New char_ptr("1000 ABCD 1234 7AB8 24FD")
gmp_lib.mpz_init_set_str(op, value, 16)
If gmp_lib.mp_bytes_per_limb = 4 Then
Assert.IsTrue(gmp_lib.mpz_size(op) = 3)
Else
Assert.IsTrue(gmp_lib.mpz_size(op) = 2)
End If
gmp_lib.mpz_clear(op)
gmp_lib.free(value)
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