X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/f21119d75514ed6013a0d6842c164867e4941ec4..a9c8f3d63588c8497aa5b3d95fa8a8d9d4c29fa8:/mp-arith.c diff --git a/mp-arith.c b/mp-arith.c index 3d565ae..53584e7 100644 --- a/mp-arith.c +++ b/mp-arith.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: mp-arith.c,v 1.16 2003/05/16 09:09:24 mdw Exp $ + * $Id: mp-arith.c,v 1.17 2003/10/12 15:03:35 mdw Exp $ * * Basic arithmetic on multiprecision integers * @@ -30,6 +30,12 @@ /*----- Revision history --------------------------------------------------* * * $Log: mp-arith.c,v $ + * Revision 1.17 2003/10/12 15:03:35 mdw + * Merge fix from other branch. + * + * Revision 1.16.2.1 2003/06/10 13:21:10 mdw + * Fix bug dividing small things by large ones. + * * Revision 1.16 2003/05/16 09:09:24 mdw * Fix @mp_lsl2c@. Turns out to be surprisingly tricky. * @@ -619,7 +625,7 @@ void mp_div(mp **qq, mp **rr, mp *a, mp *b) if (r) MP_DROP(r); r = a; - MP_DEST(r, MP_LEN(a) + 2, a->f | b->f); + MP_DEST(r, MAX(MP_LEN(a), MP_LEN(b)) + 2, a->f | b->f); /* --- Fix up the quotient too --- */