summaryrefslogtreecommitdiff
path: root/src/pow_z.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2011-03-21 02:43:09 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2011-03-21 02:43:09 +0000
commit28499b375ff46df048f5f8012a3581aa4139cf72 (patch)
tree42170bf45af8e770b17aa4b82f686f740f2b357b /src/pow_z.c
parentdbf68238a038b60a38cc5c9cf66700e39c56b6e0 (diff)
downloadmpfr-28499b375ff46df048f5f8012a3581aa4139cf72.tar.gz
[src/pow_z.c] Fixed bug bug20110320, that occurs in extremely reduced
exponent range (more precisely, if 1 is out of range, i.e. emin > 1). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7592 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/pow_z.c')
-rw-r--r--src/pow_z.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/pow_z.c b/src/pow_z.c
index 0daabb576..abf72384c 100644
--- a/src/pow_z.c
+++ b/src/pow_z.c
@@ -221,6 +221,8 @@ mpfr_pow_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mpfr_rnd_t rnd)
}
}
+ MPFR_SAVE_EXPO_MARK (expo);
+
/* detect exact powers: x^-n is exact iff x is a power of 2
Do it if n > 0 too as this is faster and this filtering is
needed in case of underflow. */
@@ -255,12 +257,9 @@ mpfr_pow_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mpfr_rnd_t rnd)
else
MPFR_SET_EXP (y, mpz_get_si (tmp));
mpz_clear (tmp);
- MPFR_RET (inexact);
+ MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
}
-
- MPFR_SAVE_EXPO_MARK (expo);
-
- if (mpz_sgn (z) > 0)
+ else if (mpz_sgn (z) > 0)
{
inexact = mpfr_pow_pos_z (y, x, z, rnd, 1);
MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);