changeset 2816:ad4bf2a82b4f

[project @ 1997-03-15 21:08:25 by jwe]
author jwe
date Sat, 15 Mar 1997 21:08:32 +0000
parents 33486d9e2d00
children 0336f54042df
files scripts/ChangeLog scripts/general/nextpow2.m
diffstat 2 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,8 @@
+Sat Mar 15 15:07:30 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* general/nextpow2.m: Correctly handle new meaning of is_scalar()
+	and is_vector().
+
 Thu Mar 13 16:36:35 1997  Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at>
 
 	* specfun/erfinv.m: Scale update by sqrt (pi) / 2.
--- a/scripts/general/nextpow2.m
+++ b/scripts/general/nextpow2.m
@@ -31,11 +31,14 @@
     usage ("nextpow2 (x)");
   endif
 
-  if (is_vector (x))
-    x = length (x);
-  elseif (! is_scalar (x))
+  if (! (is_scalar (x) || is_vector (x)))
     error ("nextpow2: x must be a scalar or a vector");
   endif
+
+  t = length (x);
+  if (t > 1)
+    x = t;
+  endif
   
   [f, n] = log2 (abs (x));
   if (f == 0.5)