diff options
author | Kevin Ryde <user42@zip.com.au> | 2001-05-11 01:46:51 +0200 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2001-05-11 01:46:51 +0200 |
commit | bddb7ea97d94ab28aef3d4ff82d8b9e5df9d9fc7 (patch) | |
tree | 569f9be327358bb4ebb14e16963ac0f23cb38f26 /mpf/ui_div.c | |
parent | 55fa9146f9fb7b39880476616f84dbc603fb105f (diff) | |
download | gmp-bddb7ea97d94ab28aef3d4ff82d8b9e5df9d9fc7.tar.gz |
* mpn/generic/tdiv_qr.c, mpq/get_d.c, mpf/div.c, mpf/set_q.c,
mpf/set_str.c, mpf/ui_div.c: Test for high bit set, not for
count_leading_zeros zero.
Diffstat (limited to 'mpf/ui_div.c')
-rw-r--r-- | mpf/ui_div.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mpf/ui_div.c b/mpf/ui_div.c index db646f263..330668ad7 100644 --- a/mpf/ui_div.c +++ b/mpf/ui_div.c @@ -32,7 +32,6 @@ mpf_ui_div (mpf_ptr r, unsigned long int u, mpf_srcptr v) mp_size_t rsize, tsize; mp_size_t sign_quotient; mp_size_t prec; - unsigned normalization_steps; mp_limb_t q_limb; mp_exp_t rexp; TMP_DECL (marker); @@ -68,13 +67,15 @@ mpf_ui_div (mpf_ptr r, unsigned long int u, mpf_srcptr v) tp = (mp_ptr) TMP_ALLOC ((tsize + 1) * BYTES_PER_MP_LIMB); MPN_ZERO (tp, tsize); - count_leading_zeros (normalization_steps, vp[vsize - 1]); /* Normalize the divisor and the dividend. */ - if (normalization_steps != 0) + if (! (vp[vsize - 1] & MP_LIMB_T_HIGHBIT)) { mp_ptr tmp; mp_limb_t dividend_high, dividend_low; + unsigned normalization_steps; + + count_leading_zeros (normalization_steps, vp[vsize - 1]); /* Shift up the divisor setting the most significant bit of the most significant limb. Use temporary storage not to clobber |