comparison scripts/general/bitget.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 16f53d29049f
children c776f063fefe
comparison
equal deleted inserted replaced
10634:60542efcfa2c 10635:d1978e7364ad
65 _conv = @int32; 65 _conv = @int32;
66 elseif (isa (A, "int64")) 66 elseif (isa (A, "int64"))
67 Amax = 64; 67 Amax = 64;
68 _conv = @int64; 68 _conv = @int64;
69 else 69 else
70 error ("invalid class %s", class (A)); 70 error ("bitget: invalid class %s", class (A));
71 endif 71 endif
72 endif 72 endif
73 73
74 m = double (n(:)); 74 m = double (n(:));
75 if (any (m < 1) || any (m > Amax)) 75 if (any (m < 1) || any (m > Amax))
76 error ("n must be in the range [1,%d]", Amax); 76 error ("bitget: n must be in the range [1,%d]", Amax);
77 endif 77 endif
78 78
79 X = bitand (A, bitshift (_conv (1), uint8 (n) - uint8 (1))) != _conv (0); 79 X = bitand (A, bitshift (_conv (1), uint8 (n) - uint8 (1))) != _conv (0);
80 endfunction 80 endfunction