summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-06-02 14:37:48 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-06-02 14:37:48 +0000
commit5b6d30371744746dd89a2fdc9bc13732a054abe8 (patch)
treeaa1ec21b7ad897f7a5e9f1cc12c89b695f33d8cc
parentad988f2360ad2b59b54769b283b8c2f7bf04a13f (diff)
parent68aa9767168cbfdef2f6b8f28cd7b1489b26d369 (diff)
downloadmpfr-5b6d30371744746dd89a2fdc9bc13732a054abe8.tar.gz
Merged the latest changes from the trunk.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/ubf@10397 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--src/exceptions.c6
-rw-r--r--src/sub1.c12
2 files changed, 10 insertions, 8 deletions
diff --git a/src/exceptions.c b/src/exceptions.c
index ffcf3e0c6..eb68d7484 100644
--- a/src/exceptions.c
+++ b/src/exceptions.c
@@ -383,8 +383,7 @@ mpfr_underflow (mpfr_ptr x, mpfr_rnd_t rnd_mode, int sign)
int inex;
MPFR_LOG_FUNC
- (("x[%Pu]=%.*Rg rnd=%d sign=%d", mpfr_get_prec (x), mpfr_log_prec, x,
- rnd_mode, sign),
+ (("rnd=%d sign=%d", rnd_mode, sign),
("x[%Pu]=%.*Rg", mpfr_get_prec (x), mpfr_log_prec, x));
MPFR_ASSERT_SIGN (sign);
@@ -412,8 +411,7 @@ mpfr_overflow (mpfr_ptr x, mpfr_rnd_t rnd_mode, int sign)
int inex;
MPFR_LOG_FUNC
- (("x[%Pu]=%.*Rg rnd=%d sign=%d", mpfr_get_prec (x), mpfr_log_prec, x,
- rnd_mode, sign),
+ (("rnd=%d sign=%d", rnd_mode, sign),
("x[%Pu]=%.*Rg", mpfr_get_prec (x), mpfr_log_prec, x));
MPFR_ASSERT_SIGN (sign);
diff --git a/src/sub1.c b/src/sub1.c
index d81b2617d..7d1938af4 100644
--- a/src/sub1.c
+++ b/src/sub1.c
@@ -233,9 +233,11 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
cp[0] = mpn_rshift (cp + 1, MPFR_MANT(c), cn++, shift_c);
}
+#ifdef DEBUG
MPFR_LOG_MSG (("rnd=%s shift_b=%d shift_c=%d diffexp=%" MPFR_EXP_FSPEC
"d\n", mpfr_print_rnd_mode (rnd_mode), shift_b, shift_c,
(mpfr_eexp_t) diff_exp));
+#endif
MPFR_ASSERTD (ap != cp);
MPFR_ASSERTD (bp != cp);
@@ -264,8 +266,10 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
else
cancel2 = - (mp_size_t) ((diff_exp - cancel) / GMP_NUMB_BITS);
/* the high cancel2 limbs from b should not be taken into account */
+#ifdef DEBUG
MPFR_LOG_MSG (("cancel=%Pd cancel1=%Pd cancel2=%Pd\n",
cancel, cancel1, cancel2));
+#endif
/* ap[an-1] ap[0]
<----------------+-----------|---->
@@ -301,8 +305,6 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
else
MPN_ZERO (ap, an);
- MPFR_LOG_VAR (a);
-
/* subtract high(c) */
if (MPFR_LIKELY(an + cancel2 > 0)) /* otherwise c does not overlap with a */
{
@@ -344,8 +346,6 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
}
}
- MPFR_LOG_VAR (a);
-
/* now perform rounding */
sh = (mpfr_prec_t) an * GMP_NUMB_BITS - aq;
/* last unused bits from a */
@@ -393,8 +393,10 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
cn0 = cn;
cn -= an + cancel2;
+#ifdef DEBUG
MPFR_LOG_MSG (("last sh=%d bits from a are %Mu, bn=%Pd, cn=%Pd\n",
sh, carry, (mpfr_prec_t) bn, (mpfr_prec_t) cn));
+#endif
/* for rounding to nearest, we couldn't conclude up to here in the following
cases:
@@ -484,7 +486,9 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
}
}
+#ifdef DEBUG
MPFR_LOG_MSG (("k=%d bb=%Mu cc=%Mu cmp_low=%d\n", k, bb, cc, cmp_low));
+#endif
if (cmp_low < 0) /* low(b) - low(c) < 0: either truncate or subtract
one ulp */