summaryrefslogtreecommitdiff
path: root/mpf/div_2exp.c
diff options
context:
space:
mode:
authortege <tege@gmplib.org>2002-05-06 15:05:24 +0200
committertege <tege@gmplib.org>2002-05-06 15:05:24 +0200
commit0e6c3fe79785bac780c57613a11a333ec6649453 (patch)
tree16e8ee3cca8e35f57f42e78aebd8ad08ad039997 /mpf/div_2exp.c
parent9a2cd598e3e9ea6f035ddc74e4c0bbc91542c459 (diff)
downloadgmp-0e6c3fe79785bac780c57613a11a333ec6649453.tar.gz
Nailify.
Diffstat (limited to 'mpf/div_2exp.c')
-rw-r--r--mpf/div_2exp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mpf/div_2exp.c b/mpf/div_2exp.c
index 870abefe3..6f70aedd5 100644
--- a/mpf/div_2exp.c
+++ b/mpf/div_2exp.c
@@ -44,7 +44,7 @@ mpf_div_2exp (mpf_ptr r, mpf_srcptr u, unsigned long int exp)
abs_usize = ABS (usize);
up = u->_mp_d;
- if (exp % BITS_PER_MP_LIMB == 0)
+ if (exp % GMP_NUMB_BITS == 0)
{
prec++; /* retain more precision here as we don't need
to account for carry-out here */
@@ -55,7 +55,7 @@ mpf_div_2exp (mpf_ptr r, mpf_srcptr u, unsigned long int exp)
}
if (rp != up)
MPN_COPY_INCR (rp, up, abs_usize);
- r->_mp_exp = uexp - exp / BITS_PER_MP_LIMB;
+ r->_mp_exp = uexp - exp / GMP_NUMB_BITS;
}
else
{
@@ -68,19 +68,20 @@ mpf_div_2exp (mpf_ptr r, mpf_srcptr u, unsigned long int exp)
/* Use mpn_rshift since mpn_lshift operates downwards, and we
therefore would clobber part of U before using that part, in case
R is the same variable as U. */
- cy_limb = mpn_rshift (rp + 1, up, abs_usize, exp % BITS_PER_MP_LIMB);
+ cy_limb = mpn_rshift (rp + 1, up, abs_usize, exp % GMP_NUMB_BITS);
rp[0] = cy_limb;
adj = rp[abs_usize] != 0;
}
else
{
- cy_limb = mpn_lshift (rp, up, abs_usize, (-exp) % BITS_PER_MP_LIMB);
+ cy_limb = mpn_lshift (rp, up, abs_usize,
+ GMP_NUMB_BITS - exp % GMP_NUMB_BITS);
rp[abs_usize] = cy_limb;
adj = cy_limb != 0;
}
abs_usize += adj;
- r->_mp_exp = uexp - exp / BITS_PER_MP_LIMB - 1 + adj;
+ r->_mp_exp = uexp - exp / GMP_NUMB_BITS - 1 + adj;
}
r->_mp_size = usize >= 0 ? abs_usize : -abs_usize;
}