diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 1999-06-25 15:53:19 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 1999-06-25 15:53:19 +0000 |
commit | 31ab4d488a289d8b19a1d4ac5de99b9ed234dc11 (patch) | |
tree | 771ca5f245fce59537c53451170b0ccae19f3466 /round.c | |
parent | 1024f2f3e526a8d67e63b57cc3ceef1b5e53917f (diff) | |
download | mpfr-31ab4d488a289d8b19a1d4ac5de99b9ed234dc11.tar.gz |
corrected allocated size in mpfr_round
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@196 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'round.c')
-rw-r--r-- | round.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -123,7 +123,7 @@ mpfr_round(mpfr_t x, char RND_MODE, unsigned long prec) xn = (PREC(x)-1) / BITS_PER_MP_LIMB + 1; if (SIGN(x)<0) xn ^= 1<<31; tmp = (mp_ptr) (*_mp_allocate_func) (nw * BYTES_PER_MP_LIMB); - carry = mpfr_round_raw(tmp, x->_mp_d, RND_MODE, xn, prec); + carry = mpfr_round_raw(tmp, MANT(x), RND_MODE, xn, prec); if (carry) { @@ -132,8 +132,8 @@ mpfr_round(mpfr_t x, char RND_MODE, unsigned long prec) EXP(x)++; } - (*_mp_free_func) (x->_mp_d, ABSSIZE(x) * BYTES_PER_MP_LIMB); - if (nw*SIGN(x)<0) CHANGE_SIGN(x); + (*_mp_free_func) (MANT(x), ABSSIZE(x) * BYTES_PER_MP_LIMB); + if (SIGN(x)<0) { SIZE(x)=nw; CHANGE_SIGN(x); } else SIZE(x)=nw; PREC(x) = prec; MANT(x) = tmp; } |