summaryrefslogtreecommitdiff
path: root/src/strtofr.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-11-16 14:31:59 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-11-16 14:31:59 +0000
commit9fad358e731d6ee245b2771860048a46f03841dd (patch)
tree59c1b5d22b1c6fc497344d1deaced94623e1cdbb /src/strtofr.c
parent6d2c534ac71c091c5213fb7f58c4278df4537954 (diff)
downloadmpfr-9fad358e731d6ee245b2771860048a46f03841dd.tar.gz
[src/strtofr.c] parsed_string_to_mpfr: added log messages.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13272 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/strtofr.c')
-rw-r--r--src/strtofr.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/strtofr.c b/src/strtofr.c
index 200a6e655..0c861defa 100644
--- a/src/strtofr.c
+++ b/src/strtofr.c
@@ -573,6 +573,7 @@ parsed_string_to_mpfr (mpfr_t x, struct parsed_string *pstr, mpfr_rnd_t rnd)
MPFR_ASSERTD (y[real_ysize - 1] != 0); /* mpn_set_str guarantees this */
count_leading_zeros (count, y[real_ysize - 1]);
diff_ysize = ysize - real_ysize;
+ MPFR_LOG_MSG (("diff_ysize = %ld\n", (long) diff_ysize));
if (diff_ysize >= 0)
{
/* We have enough limbs to store {y, real_ysize} exactly
@@ -637,6 +638,8 @@ parsed_string_to_mpfr (mpfr_t x, struct parsed_string *pstr, mpfr_rnd_t rnd)
int pow2;
mpfr_exp_t tmp;
+ MPFR_LOG_MSG (("case 1 (base = power of 2)\n", 0));
+
count_leading_zeros (pow2, (mp_limb_t) pstr->base);
pow2 = GMP_NUMB_BITS - pow2 - 1; /* base = 2^pow2 */
MPFR_ASSERTD (0 < pow2 && pow2 <= 5);
@@ -673,6 +676,8 @@ parsed_string_to_mpfr (mpfr_t x, struct parsed_string *pstr, mpfr_rnd_t rnd)
mp_limb_t *z;
mpfr_exp_t exp_z;
+ MPFR_LOG_MSG (("case 2 (exp_base > pstr_size)\n", 0));
+
result = MPFR_TMP_LIMBS_ALLOC (2 * ysize + 1);
/* z = base^(exp_base-sptr_size) using space allocated at y-ysize */
@@ -732,6 +737,8 @@ parsed_string_to_mpfr (mpfr_t x, struct parsed_string *pstr, mpfr_rnd_t rnd)
mp_limb_t *z;
mpfr_exp_t exp_z;
+ MPFR_LOG_MSG (("case 3 (exp_base < pstr_size)\n", 0));
+
result = MPFR_TMP_LIMBS_ALLOC (3 * ysize + 1);
/* y0 = y * K^ysize */
@@ -855,11 +862,15 @@ parsed_string_to_mpfr (mpfr_t x, struct parsed_string *pstr, mpfr_rnd_t rnd)
/* case exp_base = pstr_size: no multiplication or division needed */
else
{
+ MPFR_LOG_MSG (("case 4 (exp_base = pstr_size)\n", 0));
+
/* base^(exp-pr) = 1 nothing to compute */
result = y;
err = 0;
}
+ MPFR_LOG_MSG (("exact = %d, err = %d\n", exact, err));
+
/* at this point, result is an approximation rounded toward zero
of the pstr_size most significant digits of pstr->mant, with
equality in case exact is non-zero. */