diff options
-rw-r--r-- | src/round_prec.c | 2 | ||||
-rw-r--r-- | tests/tcan_round.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/round_prec.c b/src/round_prec.c index fb14bb518..9c13d8dcb 100644 --- a/src/round_prec.c +++ b/src/round_prec.c @@ -383,7 +383,7 @@ mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mpfr_exp_t err, cy = mpn_add_1 (tmp + bn - k, bp + bn - k, k, MPFR_LIMB_ONE << s); /* propagate carry up to most significant limb */ for (tn = 0; tn + 1 < k1 && cy != 0; tn ++) - cy = ~bp[bn + tn] == 0; + cy = MPFR_LIMB(~bp[bn + tn]) == 0; if (cy == 0 && err == prec) { res = 0; diff --git a/tests/tcan_round.c b/tests/tcan_round.c index 6829947d2..a514d2aca 100644 --- a/tests/tcan_round.c +++ b/tests/tcan_round.c @@ -265,12 +265,14 @@ check_can_round (void) { printf ("Error in check_can_round on:\n" "precx=%d, precy=%d, i=%d, err=%d, " - "rnd1=%s, rnd2=%s: got %d\n", + "rnd1=%s, rnd2=%s: expected %d, got %d\n", precx, precy, i, err, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd1), mpfr_print_rnd_mode ((mpfr_rnd_t) rnd2), - got); + expected, got); printf ("x="); mpfr_dump (x); + printf ("yinf="); mpfr_dump (yinf); + printf ("ysup="); mpfr_dump (ysup); exit (1); } } |