/* -*-c-*-
*
- * $Id: mptext.c,v 1.1 1999/11/17 18:02:16 mdw Exp $
+ * $Id: mptext.c,v 1.3 1999/12/10 23:23:26 mdw Exp $
*
* Textual representation of multiprecision numbers
*
/*----- Revision history --------------------------------------------------*
*
* $Log: mptext.c,v $
+ * Revision 1.3 1999/12/10 23:23:26 mdw
+ * Allocate slightly less memory.
+ *
+ * Revision 1.2 1999/11/20 22:24:15 mdw
+ * Use function versions of MPX_UMULN and MPX_UADDN.
+ *
* Revision 1.1 1999/11/17 18:02:16 mdw
* New multiprecision integer arithmetic suite.
*
/* --- Initialize the destination number --- */
- MP_MODIFY(m, 16);
+ MP_MODIFY(m, 4);
m->vl = m->v;
m->f &= ~MP_UNDEF;
/* --- Stick the character on the end of my integer --- */
- MP_ENSURE(m, MP_LEN(m) + 1);
- MPX_UMULN(m->v, m->vl, m->v, m->vl - 1, radix);
- MPX_UADDN(m->v, m->vl, x);
- MP_SHRINK(m);
+ mp_ensure(m, MP_LEN(m) + 1);
+ mpx_umuln(m->v, m->vl, m->v, m->vl - 1, radix);
+ mpx_uaddn(m->v, m->vl, x);
+ mp_shrink(m);
f |= f_ok;
}
}
dstr_destroy(&d);
+ assert(mparena_count(MPARENA_GLOBAL) == 0);
return (ok);
}