Testing of gmpy2 mpz limbs
--------------------------

    >>> import gmpy2, ctypes
    >>> from gmpy2 import xmpz
    >>> from ctypes import memmove

Test limbs_read/limbs_write/limbs_finish
----------------------------------------

    >>> x=xmpz(123456789);y=xmpz(0);
    >>> x_limbs, num_limbs=x.limbs_read(),x.num_limbs();
    >>> x_limbs != 0
    True
    >>> num_limbs > 0
    True
    >>> y_limbs=y.limbs_write(num_limbs);
    >>> y_limbs != 0
    True
    >>> memmove(y_limbs, x_limbs, num_limbs * xmpz.limb_size) > 0
    True
    >>> y.limbs_finish(num_limbs)
    >>> int(y)
    123456789

Test limbs_read/limbs_modify/limbs_finish
-----------------------------------------

    >>> x=xmpz(987654321);y=xmpz(0);
    >>> x_limbs, num_limbs=x.limbs_read(),x.num_limbs();
    >>> x_limbs != 0
    True
    >>> num_limbs > 0
    True
    >>> y_limbs=y.limbs_modify(num_limbs);
    >>> y_limbs != 0
    True
    >>> memmove(y_limbs, x_limbs, num_limbs * xmpz.limb_size) > 0
    True
    >>> y.limbs_finish(num_limbs)
    >>> int(y)
    987654321
