summaryrefslogtreecommitdiff
path: root/sub_one_ulp.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2003-05-26 15:20:27 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2003-05-26 15:20:27 +0000
commitdf63968d02aa852cb35cd2f3f77f0ce6c8b521be (patch)
tree33e6ee6e6a9cbc64dc9d6866575aacef88315b6d /sub_one_ulp.c
parent44e08c925e0e6398cb36534341f25cada6f38393 (diff)
downloadmpfr-df63968d02aa852cb35cd2f3f77f0ce6c8b521be.tar.gz
Update related to MPFR_GET_EXP and MPFR_SET_EXP.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2308 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'sub_one_ulp.c')
-rw-r--r--sub_one_ulp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sub_one_ulp.c b/sub_one_ulp.c
index 47b1e4bc8..361e5853e 100644
--- a/sub_one_ulp.c
+++ b/sub_one_ulp.c
@@ -46,7 +46,7 @@ mpfr_sub_one_ulp(mpfr_ptr x, mp_rnd_t rnd_mode)
mpn_sub_1 (xp, xp, xn, MP_LIMB_T_ONE << sh);
if (xp[xn-1] >> (BITS_PER_MP_LIMB - 1) == 0)
{ /* was an exact power of two: not normalized any more */
- mp_exp_t exp = MPFR_GET_EXP (x);
+ mp_exp_t exp = MPFR_EXP (x);
/* Note: In case of underflow and rounding to the nearest mode,
x won't be changed. Beware of infinite loops! */
if (exp == __gmpfr_emin)
@@ -54,6 +54,7 @@ mpfr_sub_one_ulp(mpfr_ptr x, mp_rnd_t rnd_mode)
else
{
mp_size_t i;
+ MPFR_ASSERTD (exp > __gmpfr_emin);
MPFR_SET_EXP (x, exp - 1);
xp[0] = (sh + 1 == BITS_PER_MP_LIMB) ? 0 : MP_LIMB_T_MAX << (sh + 1);
for (i = 1; i < xn; i++)