diff options
author | Kevin Ryde <user42@zip.com.au> | 2001-05-11 01:31:49 +0200 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2001-05-11 01:31:49 +0200 |
commit | 55fa9146f9fb7b39880476616f84dbc603fb105f (patch) | |
tree | 49361adc57674d9388e72b4d61bf936a5929a4b3 /mpq | |
parent | d1d3af5b9a51de765d4dcc0ee9eac49ac98e47fb (diff) | |
download | gmp-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 'mpq')
-rw-r--r-- | mpq/get_d.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mpq/get_d.c b/mpq/get_d.c index b069b5684..ce096ec8f 100644 --- a/mpq/get_d.c +++ b/mpq/get_d.c @@ -57,7 +57,6 @@ mpq_get_d (const MP_RAT *src) mp_size_t dsize = src->_mp_den._mp_size; mp_size_t qsize, rsize; mp_size_t sign_quotient = nsize ^ dsize; - unsigned normalization_steps; mp_limb_t qlimb; #define N_QLIMBS (1 + (sizeof (double) + BYTES_PER_MP_LIMB-1) / BYTES_PER_MP_LIMB) mp_limb_t qarr[N_QLIMBS + 1]; @@ -76,15 +75,16 @@ mpq_get_d (const MP_RAT *src) rsize = dsize + N_QLIMBS; 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 |