/* -*-c-*-
- *
- * $Id$
*
* Prime number generation
*
long l;
PyObject *rc = 0;
- if (mp_tolong_checked(PFILT_F(me)->m, &l)) goto end;
- rc = PyInt_FromLong(l);
-end:
+ if (!mp_tolong_checked(PFILT_F(me)->m, &l, 0)) rc = PyInt_FromLong(l);
+ else rc = mp_topylong(PFILT_F(me)->m);
return (rc);
}
static PyTypeObject pfilt_pytype_skel = {
PyObject_HEAD_INIT(0) 0, /* Header */
- "catacomb.PrimeFilter", /* @tp_name@ */
+ "PrimeFilter", /* @tp_name@ */
sizeof(pfilt_pyobj), /* @tp_basicsize@ */
0, /* @tp_itemsize@ */
static PyTypeObject rabin_pytype_skel = {
PyObject_HEAD_INIT(0) 0, /* Header */
- "catacomb.RabinMiller", /* @tp_name@ */
+ "RabinMiller", /* @tp_name@ */
sizeof(rabin_pyobj), /* @tp_basicsize@ */
0, /* @tp_itemsize@ */
static PyTypeObject pgevent_pytype_skel = {
PyObject_HEAD_INIT(0) 0, /* Header */
- "catacomb.PrimeGenEvent", /* @tp_name@ */
+ "PrimeGenEvent", /* @tp_name@ */
sizeof(pgevent_pyobj), /* @tp_basicsize@ */
0, /* @tp_itemsize@ */
static PyTypeObject pgev_pytype_skel = {
PyObject_HEAD_INIT(0) 0, /* Header */
- "catacomb.PrimeGenBuiltinHandler", /* @tp_name@ */
+ "PrimeGenBuiltinHandler", /* @tp_name@ */
sizeof(pgev_pyobj), /* @tp_basicsize@ */
0, /* @tp_itemsize@ */
static PyTypeObject pgstep_pytype_skel = {
PyObject_HEAD_INIT(0) 0, /* Header */
- "catacomb.PrimeGenStepper", /* @tp_name@ */
+ "PrimeGenStepper", /* @tp_name@ */
sizeof(pgstep_pyobj), /* @tp_basicsize@ */
0, /* @tp_itemsize@ */
static PyTypeObject pgjump_pytype_skel = {
PyObject_HEAD_INIT(0) 0, /* Header */
- "catacomb.PrimeGenJumper", /* @tp_name@ */
+ "PrimeGenJumper", /* @tp_name@ */
sizeof(pgjump_pyobj), /* @tp_basicsize@ */
0, /* @tp_itemsize@ */
static PyTypeObject pgtest_pytype_skel = {
PyObject_HEAD_INIT(0) 0, /* Header */
- "catacomb.PrimeGenTester", /* @tp_name@ */
+ "PrimeGenTester", /* @tp_name@ */
sizeof(pgtest_pyobj), /* @tp_basicsize@ */
0, /* @tp_itemsize@ */
strongprime_setup(NBITS, [name = 'p', event = pgen_nullev,\n\
rng = rand, nsteps = 0]) -> (START, JUMP)")
KWMETH(strongprime, "\
-strongprime_setup(NBITS, [name = 'p', event = pgen_nullev,\n\
- rng = rand, nsteps = 0]) -> P")
+strongprime(NBITS, [name = 'p', event = pgen_nullev,\n\
+ rng = rand, nsteps = 0]) -> P")
KWMETH(limlee, "\
limlee(PBITS, QBITS, [name = 'p', event = pgen_nullev,\n\
ievent = pgen_nullev, rng = rand, nsteps = 0]) -> (P, [Q, ...])")