summaryrefslogtreecommitdiff
path: root/mpf/set_q.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-05-11 01:31:49 +0200
committerKevin Ryde <user42@zip.com.au>2001-05-11 01:31:49 +0200
commit55fa9146f9fb7b39880476616f84dbc603fb105f (patch)
tree49361adc57674d9388e72b4d61bf936a5929a4b3 /mpf/set_q.c
parentd1d3af5b9a51de765d4dcc0ee9eac49ac98e47fb (diff)
downloadgmp-55fa9146f9fb7b39880476616f84dbc603fb105f.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/set_q.c')
-rw-r--r--mpf/set_q.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mpf/set_q.c b/mpf/set_q.c
index 33b43b532..ef62b832d 100644
--- a/mpf/set_q.c
+++ b/mpf/set_q.c
@@ -31,7 +31,6 @@ mpf_set_q (mpf_t r, mpq_srcptr q)
mp_size_t nsize, dsize;
mp_size_t qsize, rsize;
mp_size_t sign_quotient;
- unsigned normalization_steps;
mp_limb_t qlimb;
mp_ptr qp;
mp_size_t prec;
@@ -76,15 +75,16 @@ mpf_set_q (mpf_t r, mpq_srcptr q)
rsize = MAX (nsize, dsize);
rp = (mp_ptr) TMP_ALLOC ((rsize + 1) * BYTES_PER_MP_LIMB);
- count_leading_zeros (normalization_steps, dp[dsize - 1]);
-
/* Normalize the denominator, i.e. make its most significant bit set by
shifting it NORMALIZATION_STEPS bits to the left. Also shift the
numerator the same number of steps (to keep the quotient the same!). */
- if (normalization_steps != 0)
+ if (! (dp[dsize-1] & MP_LIMB_T_HIGHBIT))
{
mp_ptr tp;
mp_limb_t nlimb;
+ unsigned normalization_steps;
+
+ count_leading_zeros (normalization_steps, dp[dsize - 1]);
/* Shift up the denominator setting the most significant bit of
the most significant limb. Use temporary storage not to clobber