diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-09-08 17:00:40 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-09-08 17:00:40 +0000 |
commit | 3bf2518bb4947d0ef393b2fcb04997ea511ce7fe (patch) | |
tree | 254154c03f25e86f2084c13f1a6ac1a602cc083a | |
parent | c26f3d5a91814cd04a03b8690c32bc7ee57a02cc (diff) | |
download | mpfr-3bf2518bb4947d0ef393b2fcb04997ea511ce7fe.tar.gz |
[src/strtofr.c] resolved a FIXME
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13163 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | src/strtofr.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/strtofr.c b/src/strtofr.c index db7947631..5f4b80e72 100644 --- a/src/strtofr.c +++ b/src/strtofr.c @@ -563,11 +563,14 @@ parsed_string_to_mpfr (mpfr_t x, struct parsed_string *pstr, mpfr_rnd_t rnd) characters neglected from pstr->mant) */ { /* shift {y, num_limb} for (GMP_NUMB_BITS - count) bits - to the right. FIXME: can we prove that count cannot be zero here, - since mpn_rshift does not accept a shift of GMP_NUMB_BITS? */ - MPFR_ASSERTD (count != 0); - exact = mpn_rshift (y, y, real_ysize, GMP_NUMB_BITS - count) == - MPFR_LIMB_ZERO; + to the right. + When calling mpfr_set_str (y, t, b, MPFR_RNDN) with prec(y)=12, b=54 + and t = 'rrMm@-99', with GMP_NUMB_BITS=8, we get count=0 here. */ + if (count != 0) + exact = mpn_rshift (y, y, real_ysize, GMP_NUMB_BITS - count) == + MPFR_LIMB_ZERO; + else + exact = 1; /* for each bit shift increase exponent of y */ exp = GMP_NUMB_BITS - count; } |