gmp_libmpz_limbs_read Method |
Return a pointer to the limb array representing the absolute value of x.
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_ptr mpz_limbs_read(
mpz_t x
)
Public Shared Function mpz_limbs_read (
x As mpz_t
) As mp_ptr
public:
static mp_ptr^ mpz_limbs_read(
mpz_t^ x
)
static member mpz_limbs_read :
x : mpz_t -> mp_ptr
Parameters
- x
- Type: Math.Gmp.Nativempz_t
The integer.
Return Value
Type:
mp_ptrA pointer to the limb array representing the absolute value of
x.
Remarks
The size of the array is mpz_size(x). Intended for read access only.
Examples
mpz_t x = new mpz_t();
gmp_lib.mpz_init(x);
char_ptr value = new char_ptr("10000 00000000000000000000000000000000");
gmp_lib.mpz_set_str(x, value, gmp_lib.mp_bytes_per_limb == 4 ? 2 : 4);
mp_ptr limbs = gmp_lib.mpz_limbs_read(x);
Assert.IsTrue(limbs[0] == 0);
Assert.IsTrue(limbs[1] == (gmp_lib.mp_bytes_per_limb == 4 ? 16U : 256U));
gmp_lib.mpz_clear(x);
gmp_lib.free(value);
Dim x As New mpz_t()
gmp_lib.mpz_init(x)
Dim value As New char_ptr("10000 00000000000000000000000000000000")
gmp_lib.mpz_set_str(x, value, If(gmp_lib.mp_bytes_per_limb = 4, 2, 4))
Dim limbs As mp_ptr = gmp_lib.mpz_limbs_read(x)
Assert.IsTrue(limbs(0) = 0)
Assert.IsTrue(limbs(1) = (If(gmp_lib.mp_bytes_per_limb = 4, 16UI, 256UI)))
gmp_lib.mpz_clear(x)
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