summaryrefslogtreecommitdiff
path: root/src/jn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/jn.c')
-rw-r--r--src/jn.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/jn.c b/src/jn.c
index 8e9201812..af51cf2b8 100644
--- a/src/jn.c
+++ b/src/jn.c
@@ -195,6 +195,8 @@ mpfr_jn (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
if (absn > 0)
mpfr_div_2ui (t, t, absn, MPFR_RNDN);
mpfr_set (s, t, MPFR_RNDN);
+ /* note: we assume here that the maximal error is proportional to
+ 2^exps, which is true also in the case where s=0 */
exps = MPFR_IS_ZERO (s) ? MPFR_EMIN_MIN : MPFR_GET_EXP (s);
expT = exps;
for (k = 1; ; k++)
@@ -209,6 +211,7 @@ mpfr_jn (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
mpfr_div_ui (t, t, k, MPFR_RNDN);
mpfr_div_ui (t, t, k + absn, MPFR_RNDN);
}
+ /* see above note */
exps = MPFR_IS_ZERO (s) ? MPFR_EMIN_MIN : MPFR_GET_EXP (t);
if (exps > expT)
expT = exps;