Rename MP_IS* to MP_*P, for consistency's sake. Use these macros more often.
[u/mdw/catacomb] / mpbarrett-mexp.c
index 4be854d..0338527 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: mpbarrett-mexp.c,v 1.3 2004/04/08 01:36:15 mdw Exp $
+ * $Id$
  *
  * Multiple simultaneous exponentiations
  *
@@ -63,10 +63,10 @@ mp *mpbarrett_mexp(mpbarrett *mb, mp *d, const mp_expfactor *f, size_t n)
   for (i = 0; i < n; i++) {
     if (f[i].exp->f & MP_BURN)
       spare = MP_NEWSEC;
-    if (!(f[i].exp->f & MP_NEG))
-      ff[i].base = MP_COPY(f[i].base);
-    else
+    if (MP_NEGP(f[i].exp))
       ff[i].base = mp_modinv(MP_NEW, f[i].base, mb->m);
+    else
+      ff[i].base = MP_COPY(f[i].base);
     ff[i].exp = f[i].exp;
   }
   mp_drop(g);