diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-12-13 09:01:38 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-12-13 09:01:38 +0000 |
commit | 993924ff3178815425c8c35eb292a292a7b7de48 (patch) | |
tree | 49b17ac7915a94875e5a8df0d021939836b90403 | |
parent | 49ff1550c74a56acdedb15ed4c64269a4a93e38b (diff) | |
download | mpfr-993924ff3178815425c8c35eb292a292a7b7de48.tar.gz |
[src/mul.c] fixed bug in mpfr_mul() when sizeof(mp_limb_t) < sizeof(mpfr_exp_t)
(same issue as in r13338)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13339 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | src/mul.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1065,7 +1065,8 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) mpn_lshift (tmp, tmp, tn, 1); /* tn <= k, so no stack corruption */ } - ax2 = ax + (mpfr_exp_t) (b1 - 1); + /* b1 is 0 or 1 (most significant bit from the raw product) */ + ax2 = ax + ((int) b1 - 1); MPFR_RNDRAW (inexact, a, tmp, bq + cq, rnd_mode, sign, ax2++); MPFR_TMP_FREE (marker); MPFR_EXP (a) = ax2; /* Can't use MPFR_SET_EXP: Expo may be out of range */ |