summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzimmerma <zimmerma@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2012-02-29 17:23:30 +0000
committerzimmerma <zimmerma@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2012-02-29 17:23:30 +0000
commitff7a9785309cc0c455c37ccdf3aac308920a3195 (patch)
treefe2291e06b148c1d0248a6bb12ab583176bb06d1
parent78a5cd8a53f06ad2963f11e9b062ccb2def7722a (diff)
downloadmpc-ff7a9785309cc0c455c37ccdf3aac308920a3195.tar.gz
[sqr.c] fix for new sqr.dat failure
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@1130 211d60ee-9f03-0410-a15a-8952a2c7a4e4
-rw-r--r--src/sqr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sqr.c b/src/sqr.c
index 1cdba5a..4f0046c 100644
--- a/src/sqr.c
+++ b/src/sqr.c
@@ -95,6 +95,9 @@ mpc_sqr (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
mpfr_get_exp (mpc_realref (op)) - mpfr_get_exp (mpc_imagref (op)))
> (mpfr_exp_t) MPC_MAX_PREC (op) / 2)
{
+ emax = mpfr_get_emax ();
+ mpfr_set_emax (mpfr_get_emax_max ());
+
mpfr_init2 (u, 2*MPC_PREC_RE (op));
mpfr_init2 (v, 2*MPC_PREC_IM (op));
@@ -106,6 +109,9 @@ mpc_sqr (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
mpfr_clear (u);
mpfr_clear (v);
+ mpfr_set_emax (emax);
+ inex_re = mpfr_check_range (rop->re, inex_re, MPC_RND_RE (rnd));
+ inex_im = mpfr_check_range (rop->im, inex_im, MPC_RND_IM (rnd));
return MPC_INEX (inex_re, inex_im);
}