Rename MP_IS* to MP_*P, for consistency's sake. Use these macros more often.
[u/mdw/catacomb] / mp-sqrt.c
index 01fe000..d18d183 100644 (file)
--- a/mp-sqrt.c
+++ b/mp-sqrt.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: mp-sqrt.c,v 1.5 2004/04/08 01:36:15 mdw Exp $
+ * $Id$
  *
  * Compute integer square roots
  *
@@ -54,7 +54,7 @@ mp *mp_sqrt(mp *d, mp *a)
 
   /* --- Sanity preservation --- */
 
-  assert(((void)"imaginary root in mp_sqrt", !(a->f & MP_NEG)));
+  assert(!MP_NEGP(a));
 
   /* --- Deal with trivial cases --- */
 
@@ -86,7 +86,7 @@ mp *mp_sqrt(mp *d, mp *a)
     q = mp_sub(q, q, a);
     if (q->v == q->vl)
       break;
-    if (q->f & MP_NEG) {
+    if (MP_NEGP(q)) {
       r = mp_lsl(r, d, 1);
       r->f |= MP_NEG;
       if (MP_CMP(q, <=, r))