summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2018-04-11 06:51:30 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2018-04-11 06:51:30 +0000
commit0155707b7414b756e4dc4af7875b812008be5397 (patch)
treeed6cb4d5eb0e24b541f88e7687b43e6dd089fc22 /src
parent4360ee19b7eaa89dc5f96f55dbe9eb14dbd924d4 (diff)
downloadmpfr-0155707b7414b756e4dc4af7875b812008be5397.tar.gz
[src/strtofr.c] fixed bug in corner cases
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@12573 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src')
-rw-r--r--src/strtofr.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/strtofr.c b/src/strtofr.c
index 6e6142729..4a6cbd456 100644
--- a/src/strtofr.c
+++ b/src/strtofr.c
@@ -681,18 +681,7 @@ parsed_string_to_mpfr (mpfr_t x, struct parsed_string *pstr, mpfr_rnd_t rnd)
if (h >= ysize) /* not enough precision in z */
goto next_loop;
- cy = mpn_add_1 (z, z, ysize - h, MPFR_LIMB_ONE << l);
- /* Note: it is very unlikely that we can have a carry in the
- above addition. Indeed, this would mean that an integer
- power of pstr->base has its ysize most significant
- limbs >= 1000...000 - 2^err.
- For example if base=3, the largest convergent of the
- continued fraction of log(2^64)/log(3) with numerator less
- than 2^32 is the 36th convergent
- 5832963307408086805/144453564223816677,
- and 3^5832963307408086805/B^144453564223816677 is less than
- 1 - 2^(-124), which means that if ysize >= 3 and err <= 64,
- there can be no carry. */
+ cy = mpn_add_1 (z + h, z + h, ysize - h, MPFR_LIMB_ONE << l);
if (cy != 0) /* the code below requires z on ysize limbs */
goto next_loop;
}