changeset 21558:d42aa6780175 stable

Initialize variable to stop unstable results for lgamma (bug #47524). * lo-specfun.cc (rc_lgamma (double x), rc_lgamma (float x)): Initialize sgngam variable to 0.
author Rik <rik@octave.org>
date Tue, 29 Mar 2016 07:42:23 -0700
parents 9f0088f3f335
children 6619945e4434 8fc45dd1cac6
files liboctave/numeric/lo-specfun.cc
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/numeric/lo-specfun.cc	Mon Mar 28 22:00:43 2016 -0400
+++ b/liboctave/numeric/lo-specfun.cc	Tue Mar 29 07:42:23 2016 -0700
@@ -416,7 +416,7 @@
   int sgngam;
   result = lgamma_r (x, &sgngam);
 #else
-  double sgngam;
+  double sgngam = 0.0;
 
   if (xisnan (x))
     result = x;
@@ -488,7 +488,7 @@
   int sgngam;
   result = lgammaf_r (x, &sgngam);
 #else
-  float sgngam;
+  float sgngam = 0.0f;
 
   if (xisnan (x))
     result = x;