Mercurial > hg > octave-nkf
diff scripts/general/bitset.m @ 17391:7d8d194f3f63
bitget.m, bitset.m: Make max bit index consistent
* bitget.m, bitset.m: Compute maximum bit index consistently.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Sun, 08 Sep 2013 17:51:23 -0400 |
parents | d4b4080faa47 |
children | e09cd91168d1 |
line wrap: on
line diff
--- a/scripts/general/bitset.m +++ b/scripts/general/bitset.m @@ -54,10 +54,10 @@ if (isfloat (A) && isreal (A)) Bmax = bitmax (cl); - Amax = log2 (Bmax); + Amax = ceil (log2 (Bmax)); elseif (isinteger (A)) Bmax = intmax (cl); - Amax = round (log2 (Bmax)); + Amax = ceil (log2 (Bmax)); else error ("bitset: invalid class %s", cl); endif