diff options
-rw-r--r-- | mul.c | 2 | ||||
-rw-r--r-- | mulders.c | 1 |
2 files changed, 3 insertions, 0 deletions
@@ -349,6 +349,8 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) if (MPFR_UNLIKELY (b1 == 0)) mpn_lshift (tmp, tmp, tn, 1); + MPFR_ASSERTD (MPFR_LIMB_MSB (tmp[tn-1]) != 0); + if (MPFR_UNLIKELY (!mpfr_can_round_raw (tmp, tn, sign, p + b1 - 1, GMP_RNDN, GMP_RNDZ, MPFR_PREC(a)+(rnd_mode==GMP_RNDN)))) goto full_multiply; @@ -51,6 +51,7 @@ mpfr_mulhigh_n (mp_ptr rp, mp_srcptr np, mp_srcptr mp, mp_size_t n) MPFR_ASSERTD (MPFR_MULHIGH_TAB_SIZE > 4); k = MPFR_LIKELY (n < MPFR_MULHIGH_TAB_SIZE) ? mulhigh_ktab[n] : 2*n/3; + MPFR_ASSERTD (k == -1 || k == 0 || (k > n/2 && k < n)); if (k < 0) mpn_mul_basecase (rp, np, n, mp, n); else if (k == 0) |