summaryrefslogtreecommitdiff
path: root/src/sqr.c
diff options
context:
space:
mode:
authorAndreas Enge <andreas.enge@inria.fr>2011-01-30 12:31:46 +0000
committerAndreas Enge <andreas.enge@inria.fr>2011-01-30 12:31:46 +0000
commite6fcfe4d6746aa8a1daac5681a1968897bd6706a (patch)
tree8d9037bafdaa48da81f85c7126f22199a59c3fba /src/sqr.c
parent071b0be767733a3e2f65db4af09da887184fe241 (diff)
downloadmpc-git-e6fcfe4d6746aa8a1daac5681a1968897bd6706a.tar.gz
sqr, pow: removed extension of exponent range
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/mpc/trunk@900 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'src/sqr.c')
-rw-r--r--src/sqr.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/sqr.c b/src/sqr.c
index c7110b4..a324f15 100644
--- a/src/sqr.c
+++ b/src/sqr.c
@@ -1,6 +1,6 @@
/* mpc_sqr -- Square a complex number.
-Copyright (C) INRIA, 2002, 2005, 2008, 2009, 2010
+Copyright (C) INRIA, 2002, 2005, 2008, 2009, 2010, 2011
This file is part of the MPC Library.
@@ -32,7 +32,7 @@ mpc_sqr (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
needed in the case rop==op */
mpfr_prec_t prec;
int inex_re, inex_im, inexact;
- mpfr_exp_t old_emax, old_emin, emin, emax;
+ mpfr_exp_t emin, emax;
/* special values: NaN and infinities */
if (!mpc_fin_p (op)) {
@@ -122,11 +122,8 @@ mpc_sqr (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
else
x [0] = op->re [0];
- /* store the maximal exponent */
- old_emax = mpfr_get_emax ();
- old_emin = mpfr_get_emin ();
- mpfr_set_emax (emax = mpfr_get_emax_max ());
- mpfr_set_emin (emin = mpfr_get_emin_min ());
+ emax = mpfr_get_emax ();
+ emin = mpfr_get_emin ();
do
{
@@ -237,10 +234,6 @@ mpc_sqr (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
if (rop == op)
mpfr_clear (x);
- /* restore the exponent range */
- mpfr_set_emax (old_emax);
- mpfr_set_emin (old_emin);
-
inex_re = mpfr_check_range (MPC_RE(rop), inex_re, MPC_RND_RE (rnd));
inex_im = mpfr_check_range (MPC_IM(rop), inex_im, MPC_RND_IM (rnd));