summaryrefslogtreecommitdiff
path: root/exp2.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-12 16:38:47 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-12 16:38:47 +0000
commita496d7ef76b3001cca1ced0270ea60394f1644f5 (patch)
tree4ccef1683f123a5cf392e2cec0516cabbb241b87 /exp2.c
parentd1a1c6c7f0309dc4c33f3bda7e1a1ed2f1bc8fdf (diff)
downloadmpfr-a496d7ef76b3001cca1ced0270ea60394f1644f5.tar.gz
we need m >= 2 in mpfr_exp2_aux2
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@848 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'exp2.c')
-rw-r--r--exp2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/exp2.c b/exp2.c
index 4ee374031..3f59479da 100644
--- a/exp2.c
+++ b/exp2.c
@@ -319,6 +319,8 @@ mpfr_exp2_aux2(s, r, q, exps)
/* estimate value of l */
l = q / (-MPFR_EXP(r));
m = (int) sqrt((double) l);
+ /* we access R[2], thus we need m >= 2 */
+ if (m < 2) m = 2;
TMP_MARK(marker);
R = (mpz_t*) TMP_ALLOC((m+1)*sizeof(mpz_t)); /* R[i] stands for r^i */
expR = (int*) TMP_ALLOC((m+1)*sizeof(int)); /* exponent for R[i] */