Minor changes for different `mptypes.h' format.
authormdw <mdw>
Thu, 11 Nov 1999 17:47:55 +0000 (17:47 +0000)
committermdw <mdw>
Thu, 11 Nov 1999 17:47:55 +0000 (17:47 +0000)
mpx.h

diff --git a/mpx.h b/mpx.h
index edaea71..0f1a91d 100644 (file)
--- a/mpx.h
+++ b/mpx.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: mpx.h,v 1.1 1999/09/03 08:41:12 mdw Exp $
+ * $Id: mpx.h,v 1.2 1999/11/11 17:47:55 mdw Exp $
  *
  * Low level multiprecision arithmetic
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: mpx.h,v $
+ * Revision 1.2  1999/11/11 17:47:55  mdw
+ * Minor changes for different `mptypes.h' format.
+ *
  * Revision 1.1  1999/09/03 08:41:12  mdw
  * Initial import.
  *
 #  include "mptypes.h"
 #endif
 
+/*----- Basic macros ------------------------------------------------------*/
+
+/* --- @MPW@ --- *
+ *
+ * Arguments:   @x@ = an unsigned value
+ *
+ * Use:         Expands to the value of @x@ masked and typecast to a
+ *              multiprecision integer word.
+ */
+
+#define MPW(x) ((mpw)((x) & MPW_MAX))
+
+/* --- @MPWS@ --- *
+ *
+ * Arguments:   @n@ = number of words
+ *
+ * Use:         Expands to the number of bytes occupied by a given number of
+ *              words.
+ */
+
+#define MPWS(n) ((n) * sizeof(mpw))
+
 /*----- General manipulation ----------------------------------------------*/
 
 /* --- @MPX_SHRINK@ --- *