summaryrefslogtreecommitdiff
path: root/round.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>1999-06-25 15:53:19 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>1999-06-25 15:53:19 +0000
commit31ab4d488a289d8b19a1d4ac5de99b9ed234dc11 (patch)
tree771ca5f245fce59537c53451170b0ccae19f3466 /round.c
parent1024f2f3e526a8d67e63b57cc3ceef1b5e53917f (diff)
downloadmpfr-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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/round.c b/round.c
index c91e1fbf0..0e11a07ca 100644
--- a/round.c
+++ b/round.c
@@ -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;
}