summaryrefslogtreecommitdiff
path: root/src/lngamma.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2014-02-05 01:00:58 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2014-02-05 01:00:58 +0000
commitced419246feda9a02608cf80327868c573729d2f (patch)
tree372988d58dc8474240e03655d79db4c5a2b6cdd5 /src/lngamma.c
parentfd4948d6f3658cccdc714d1fd70ba743f93fc049 (diff)
downloadmpfr-ced419246feda9a02608cf80327868c573729d2f.tar.gz
[src/lngamma.c] Fixed bug introduced in the latest change r8917
(inexact was not initialized in the case compared < 0). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8918 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/lngamma.c')
-rw-r--r--src/lngamma.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lngamma.c b/src/lngamma.c
index a2adb2bee..e105b7bd2 100644
--- a/src/lngamma.c
+++ b/src/lngamma.c
@@ -318,6 +318,8 @@ GAMMA_FUNC (mpfr_ptr y, mpfr_srcptr z0, mpfr_rnd_t rnd)
mpfr_init2 (v, MPFR_PREC_MIN);
mpfr_init2 (z, MPFR_PREC_MIN);
+ inexact = 0; /* 0 means: result y not set yet */
+
if (compared < 0)
{
mpfr_exp_t err_u;
@@ -420,8 +422,6 @@ GAMMA_FUNC (mpfr_ptr y, mpfr_srcptr z0, mpfr_rnd_t rnd)
MPFR_ASSERTD (compared > 0);
- inexact = 0; /* 0 means: result y not set yet */
-
/* since k is O(w), the value of log(z0*...*(z0+k-1)) is about w*log(w),
so there is a cancellation of ~log(w) in the argument reconstruction */
w = precy + MPFR_INT_CEIL_LOG2 (precy);