X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/50bea2afb9ce9099b4c9e45f4f633821143aacc6..75263f25a1ce8e7b38ad4bd61a9a893723ec1db3:/mp-arith.c diff --git a/mp-arith.c b/mp-arith.c index a070675..759056b 100644 --- a/mp-arith.c +++ b/mp-arith.c @@ -1,6 +1,6 @@ /* -*-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 * @@ -30,6 +30,9 @@ /*----- 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. * @@ -318,7 +321,7 @@ mp *mp_neg(mp *d, mp *a) \ 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); \