# HG changeset patch # User jwe # Date 858460112 0 # Node ID ad4bf2a82b4f3b422f99c0727aa466138304cc0e # Parent 33486d9e2d0073c80e90cbbfa11a182aab24986c [project @ 1997-03-15 21:08:25 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +Sat Mar 15 15:07:30 1997 John W. Eaton + + * general/nextpow2.m: Correctly handle new meaning of is_scalar() + and is_vector(). + Thu Mar 13 16:36:35 1997 Kurt Hornik * specfun/erfinv.m: Scale update by sqrt (pi) / 2. diff --git a/scripts/general/nextpow2.m b/scripts/general/nextpow2.m --- 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)