diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-05-26 12:03:59 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-05-26 12:03:59 +0000 |
commit | 77b541466832f52234f8a1a6eab8563578644276 (patch) | |
tree | 636e34a57468c90fcf234aa28956abe5966f1376 /set.c | |
parent | 05229d461f6d634c690592bde0ab1308d8c6e0ad (diff) | |
download | mpfr-77b541466832f52234f8a1a6eab8563578644276.tar.gz |
Updates/optimizations related to MPFR_GET_EXP and MPFR_SET_EXP.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2305 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'set.c')
-rw-r--r-- | set.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -62,11 +62,10 @@ mpfr_set4 (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode, int signb) carry = mpfr_round_raw(ap, MPFR_MANT(b), MPFR_PREC(b), (signb < 0), aq, rnd_mode, &inex); - MPFR_SET_EXP (a, MPFR_GET_EXP (b)); if (carry) { - mp_exp_t exp = MPFR_GET_EXP (a); + mp_exp_t exp = MPFR_GET_EXP (b); if (exp == __gmpfr_emax) return mpfr_set_overflow(a, rnd_mode, signb); @@ -74,6 +73,8 @@ mpfr_set4 (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode, int signb) MPFR_SET_EXP(a, exp + 1); ap[(MPFR_PREC(a)-1)/BITS_PER_MP_LIMB] = MPFR_LIMB_HIGHBIT; } + else + MPFR_SET_EXP (a, MPFR_GET_EXP (b)); } } |