diff options
author | Andreas Enge <andreas.enge@inria.fr> | 2011-01-30 12:31:46 +0000 |
---|---|---|
committer | Andreas Enge <andreas.enge@inria.fr> | 2011-01-30 12:31:46 +0000 |
commit | e6fcfe4d6746aa8a1daac5681a1968897bd6706a (patch) | |
tree | 8d9037bafdaa48da81f85c7126f22199a59c3fba /src/sqr.c | |
parent | 071b0be767733a3e2f65db4af09da887184fe241 (diff) | |
download | mpc-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.c | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -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)); |