Mercurial > hg > octave-lyh
diff scripts/general/bitcmp.m @ 10635:d1978e7364ad
Print name of function in error() string messages.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 16 May 2010 22:26:54 -0700 |
parents | 1bf0ce0930be |
children | c776f063fefe |
line wrap: on
line diff
--- a/scripts/general/bitcmp.m +++ b/scripts/general/bitcmp.m @@ -43,7 +43,7 @@ endif if (nargin == 2 && (! isscalar (n) || (floor (n) != n))) - error ("k must be a scalar integer"); + error ("bitcmp: k must be a scalar integer"); endif if (isa (a, "double")) @@ -67,7 +67,7 @@ elseif (isa (a, "int64")) amax = 64; else - error ("invalid class %s", class (a)); + error ("bitcmp: invalid class %s", class (a)); endif bmax = intmax (class (a)); endif @@ -77,7 +77,7 @@ else m = double (n); if (any (m < 1) || any (m > amax)) - error ("n must be in the range [1,%d]", amax); + error ("bitcmp: n must be in the range [1,%d]", amax); endif mask = bitshift (bmax, n - amax); x = bitxor (bitand (a, mask), mask);