gnumeric r16590 - in branches/gnumeric-1-8: . src



Author: mortenw
Date: Tue May 20 13:44:19 2008
New Revision: 16590
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16590&view=rev

Log:
2008-05-20  Morten Welinder  <terra gnome org>

	* src/mathfunc.c (random_exppow): Add domain check.  Fixes #533965.



Modified:
   branches/gnumeric-1-8/ChangeLog
   branches/gnumeric-1-8/NEWS
   branches/gnumeric-1-8/src/mathfunc.c

Modified: branches/gnumeric-1-8/NEWS
==============================================================================
--- branches/gnumeric-1-8/NEWS	(original)
+++ branches/gnumeric-1-8/NEWS	Tue May 20 13:44:19 2008
@@ -36,6 +36,7 @@
 	* Fix critical spew.  [#533511]
 	* Fix OPT_BS_DELTA assert.  [#533656]
 	* Fix parser crashes.  [#533951]
+	* Fix RANDEXPPOW hang.  [#533965]
 
 --------------------------------------------------------------------------
 Gnumeric 1.8.2

Modified: branches/gnumeric-1-8/src/mathfunc.c
==============================================================================
--- branches/gnumeric-1-8/src/mathfunc.c	(original)
+++ branches/gnumeric-1-8/src/mathfunc.c	Tue May 20 13:44:19 2008
@@ -7208,6 +7208,10 @@
 gnm_float
 random_exppow (gnm_float a, gnm_float b)
 {
+	/* See http://www.mcgill.ca/files/economics/propertiesandestimation.pdf */
+	if (!(a > 0) || gnm_isnan (b))
+		return gnm_nan;
+
 	if (b < 1) {
 		gnm_float u = random_01 ();
 		gnm_float v = random_gamma (1 / b, 1.0);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]