changeset 10330:e0767a0965f1

fix some stat functions with integers
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 17 Feb 2010 13:31:20 +0100
parents 83fa590b8a09
children 6a50aa2cdf00
files scripts/ChangeLog scripts/statistics/base/center.m
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Wed Feb 17 10:40:36 2010 +0100
+++ b/scripts/ChangeLog	Wed Feb 17 13:31:20 2010 +0100
@@ -1,3 +1,7 @@
+2010-02-17  Jaroslav Hajek  <highegg@gmail.com>
+
+	* statistics/base/center.m: Convert integer inputs to doubles.
+
 2010-02-17  Jaroslav Hajek  <highegg@gmail.com>
 
 	* general/interp2: Slightly optimize linear interpolation.
--- a/scripts/statistics/base/center.m	Wed Feb 17 10:40:36 2010 +0100
+++ b/scripts/statistics/base/center.m	Wed Feb 17 13:31:20 2010 +0100
@@ -41,6 +41,10 @@
   endif
   n = size (x, dim);
 
+  if (isinteger (x))
+    x = double (x);
+  endif
+
   if (n == 0)
     retval = x;
   else