Rename MP_IS* to MP_*P, for consistency's sake. Use these macros more often.
[u/mdw/catacomb] / mp.h
diff --git a/mp.h b/mp.h
index 8319173..f6fa14f 100644 (file)
--- a/mp.h
+++ b/mp.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: mp.h,v 1.19 2004/04/08 01:36:15 mdw Exp $
+ * $Id$
  *
  * Simple multiprecision arithmetic
  *
@@ -363,7 +363,7 @@ extern void mp_shrink(mp */*m*/);
 #define MP_SHRINK(m) do {                                              \
   mp *_mm = (m);                                                       \
   MPX_SHRINK(_mm->v, _mm->vl);                                         \
-  if (!MP_LEN(_mm))                                                    \
+  if (MP_ZEROP(_mm))                                                   \
     _mm->f &= ~MP_NEG;                                                 \
 } while (0)
 
@@ -795,11 +795,11 @@ extern int mp_cmp(const mp */*a*/, const mp */*b*/);
 
 /* --- Other handy macros --- */
 
-#define MP_ISNEG(x) ((x)->f & MP_NEG)
-#define MP_ISZERO(x) (!MP_LEN(x))
-#define MP_ISPOS(x) (!MP_ISNEG(x) && !MP_ISZERO(x))
-#define MP_ISODD(x) (!MP_ISZERO(x) && ((x)->v[0] & 1u))
-#define MP_ISEVEN(x) (!MP_ISODD(x))
+#define MP_NEGP(x) ((x)->f & MP_NEG)
+#define MP_ZEROP(x) (!MP_LEN(x))
+#define MP_POSP(x) (!MP_NEGP(x) && !MP_ZEROP(x))
+#define MP_ODDP(x) (!MP_ZEROP(x) && ((x)->v[0] & 1u))
+#define MP_EVENP(x) (!MP_ODDP(x))
 
 /*----- Arithmetic operations ---------------------------------------------*/