diff options
-rw-r--r-- | mpn/generic/rootrem.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mpn/generic/rootrem.c b/mpn/generic/rootrem.c index 168baa9e5..bcfeaed82 100644 --- a/mpn/generic/rootrem.c +++ b/mpn/generic/rootrem.c @@ -70,7 +70,7 @@ mpn_rootrem (mp_ptr rootp, mp_ptr remp, count_leading_zeros (cnt, up[un - 1]); unb = un * GMP_NUMB_BITS - cnt + GMP_NAIL_BITS; - xnb = (unb + nth - 1) / nth; + xnb = (unb - 1) / nth + 1; if (xnb == 1) { if (remp == NULL) @@ -114,8 +114,8 @@ mpn_rootrem (mp_ptr rootp, mp_ptr remp, adj = n_valid_bits - 1; /* Newton loop. Converges downwards towards root(U,nth). Currently we use - full precision from iteration 1. Clearly, we should use just n_valid_bits - of precision in each step, and thus save most of the computations. */ + full precision from iteration 1. Clearly, we should use just n_valid_bits + of precision in each step, and thus save most of the computations. */ while (n_valid_bits <= xnb) { mp_limb_t cy; |