~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
key.c: Make `KeyDataStructured' constructor cleanup less bizarre.
[catacomb-python]
/
field.c
diff --git
a/field.c
b/field.c
index
ba00d34
..
2e99efc
100644
(file)
--- a/
field.c
+++ b/
field.c
@@
-174,7
+174,10
@@
static PyObject *fe_pyexp(PyObject *x, PyObject *y, PyObject *z)
field *ff;
mp *xx, *yy;
field *ff;
mp *xx, *yy;
- if (z != Py_None || !FE_PYCHECK(x) || (yy = implicitmp(y)) == 0)
+ if (z != Py_None || !FE_PYCHECK(x)) RETURN_NOTIMPL;
+ if (FE_PYCHECK(y) && FE_F(y)->ops->ty == FTY_PRIME)
+ yy = F_OUT(FE_F(y), MP_NEW, FE_X(y));
+ else if ((yy = implicitmp(y)) == 0)
RETURN_NOTIMPL;
ff = FE_F(x); xx = FE_X(x); MP_COPY(xx);
if (MP_NEGP(yy) && F_ZEROP(ff, xx)) ZDIVERR("division by zero");
RETURN_NOTIMPL;
ff = FE_F(x); xx = FE_X(x); MP_COPY(xx);
if (MP_NEGP(yy) && F_ZEROP(ff, xx)) ZDIVERR("division by zero");