summaryrefslogtreecommitdiff
path: root/pow.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2008-08-16 01:04:05 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2008-08-16 01:04:05 +0000
commitd3a66785087e65de58afeba53aaee0d7f4a02431 (patch)
treebe261a36d0c641b00f68cf5bdea0036f95e45f3d /pow.c
parent612fd36a3acaf2960e3c85543e24994552fa77a0 (diff)
downloadmpfr-d3a66785087e65de58afeba53aaee0d7f4a02431.tar.gz
pow.c: updated comments.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5533 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'pow.c')
-rw-r--r--pow.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pow.c b/pow.c
index ddd06c91d..e9825ae7b 100644
--- a/pow.c
+++ b/pow.c
@@ -538,6 +538,8 @@ mpfr_pow (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd_mode)
}
}
+ /* FIXME: basic underflow checking is incomplete. This is needed
+ for the special case (+/-2^b)^Y below. */
/* detect underflows: for x > 0, y < 0, |x^y| = |(1/x)^(-y)|
<= 2^((1-EXP(x))*(-y)) */
if (MPFR_IS_NEG(y) && MPFR_EXP(x) > 1)
@@ -602,9 +604,9 @@ mpfr_pow (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd_mode)
inexact = mpfr_mul_si (tmp, y, b, GMP_RNDN); /* exact */
MPFR_ASSERTN (inexact == 0);
/* Note: as the exponent range has been extended, an overflow is not
- possible (due to basic overflow checking above, as the result is
- ~ 2^tmp), and an underflow is not possible either because b is an
- integer (thus either 0 or >= 1). */
+ possible (due to basic overflow and underflow checking above, as
+ the result is ~ 2^tmp), and an underflow is not possible either
+ because b is an integer (thus either 0 or >= 1). */
mpfr_clear_flags ();
inexact = mpfr_exp2 (z, tmp, rnd_mode);
mpfr_clear (tmp);