[gnumeric] RANDLEVY: fix argument handling.



commit e3745441dc1f8231d4daa08b7198a1afd4fcf659
Author: Morten Welinder <terra gnome org>
Date:   Fri Jun 11 21:56:14 2010 -0400

    RANDLEVY: fix argument handling.

 NEWS                          |    1 +
 plugins/fn-random/ChangeLog   |    4 ++++
 plugins/fn-random/functions.c |    2 +-
 3 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 4565231..0088596 100644
--- a/NEWS
+++ b/NEWS
@@ -34,6 +34,7 @@ Morten:
 	* Modernize code for LINEST, LOGEST, and  LOGREG.  [#317426]
 	* GEOMDIST: avoid overflow in extreme cases.
 	* SFTEST: improve extreme-case precision.
+	* Fix RANDLEVY.
 
 --------------------------------------------------------------------------
 Gnumeric 1.10.5
diff --git a/plugins/fn-random/ChangeLog b/plugins/fn-random/ChangeLog
index 471b4cb..bd83dd6 100644
--- a/plugins/fn-random/ChangeLog
+++ b/plugins/fn-random/ChangeLog
@@ -1,3 +1,7 @@
+2010-06-11  Morten Welinder  <terra gnome org>
+
+	* functions.c (gnumeric_randlevy): Fix extraction of beta.
+
 2010-06-10 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* functions.c: remove superfluous spaces, inconsitent periods, etc.
diff --git a/plugins/fn-random/functions.c b/plugins/fn-random/functions.c
index 5a2bba7..6a00f5a 100644
--- a/plugins/fn-random/functions.c
+++ b/plugins/fn-random/functions.c
@@ -736,7 +736,7 @@ gnumeric_randlevy (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 {
 	gnm_float c     = value_get_as_float (argv[0]);
 	gnm_float alpha = value_get_as_float (argv[1]);
-	gnm_float beta  = argv[2] == NULL ? 0 : value_get_as_float (argv[1]);
+	gnm_float beta  = argv[2] ? value_get_as_float (argv[2]): 0;
 
 	if (alpha <= 0 || alpha > 2 || beta < -1 || beta > 1)
 		return value_new_error_NUM (ei->pos);



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