Example #1
0
/* hex/oct formatting (mpz-only) */
static PyObject *
GMPy_XMPZ_Oct_Slot(XMPZ_Object *self)
{
    CTXT_Object *context = NULL;

    CHECK_CONTEXT(context);

    return GMPy_PyStr_From_XMPZ(self, 8, 0, context);
}
Example #2
0
static PyObject *
GMPy_XMPZ_Digits_Method(PyObject *self, PyObject *args)
{
    int base = 10;

    if (PyTuple_GET_SIZE(args) && !PyArg_ParseTuple(args, "|i", &base)) {
        return NULL;
    }

    return  GMPy_PyStr_From_XMPZ((XMPZ_Object*)self, base, 0, NULL);
}