diff options
Diffstat (limited to 'set_ui.c')
-rw-r--r-- | set_ui.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,6 +1,6 @@ /* mpfr_set_ui -- set a MPFR number from a machine unsigned integer -Copyright 1999, 2000, 2001, 2002 Free Software Foundation. +Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation. This file is part of the MPFR Library. @@ -48,7 +48,8 @@ mpfr_set_ui (mpfr_ptr x, unsigned long i, mp_rnd_t rnd_mode) /* don't forget to put zero in lower limbs */ MPN_ZERO(xp, xn); - MPFR_EXP(x) = nbits = BITS_PER_MP_LIMB - cnt; + nbits = BITS_PER_MP_LIMB - cnt; + MPFR_SET_EXP (x, nbits); inex = mpfr_check_range(x, 0, rnd_mode); if (inex) return inex; /* underflow or overflow */ @@ -61,12 +62,12 @@ mpfr_set_ui (mpfr_ptr x, unsigned long i, mp_rnd_t rnd_mode) rnd_mode, &inex); if (carry) { - mp_exp_t exp = MPFR_EXP(x); + mp_exp_t exp = MPFR_GET_EXP (x); if (exp == __gmpfr_emax) return mpfr_set_overflow(x, rnd_mode, 1); - MPFR_EXP(x)++; + MPFR_SET_EXP (x, exp + 1); xp[xn] = MPFR_LIMB_HIGHBIT; } } |