/* -*-c-*-
*
- * $Id: mp-arith.c,v 1.14 2002/10/15 19:18:31 mdw Exp $
+ * $Id: mp-arith.c,v 1.15 2002/10/19 17:56:50 mdw Exp $
*
* Basic arithmetic on multiprecision integers
*
/*----- Revision history --------------------------------------------------*
*
* $Log: mp-arith.c,v $
+ * Revision 1.15 2002/10/19 17:56:50 mdw
+ * Fix bit operations. Test them (a bit) better.
+ *
* Revision 1.14 2002/10/15 19:18:31 mdw
* New operation to negate numbers.
*
\
mp *mp_bit##string(mp *d, mp *a, mp *b) \
{ \
- MP_DEST(d, MAX(MP_LEN(a), MP_LEN(b)), a->f | b->f); \
+ MP_DEST(d, MAX(MP_LEN(a), MP_LEN(b)), (a->f | b->f) & ~MP_NEG); \
mpx_bit##string(d->v, d->vl, a->v, a->vl, b->v, b->vl); \
d->f = (a->f | b->f) & MP_BURN; \
MP_SHRINK(d); \