octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More on bitfcns


From: Jaroslav Hajek
Subject: Re: More on bitfcns
Date: Mon, 20 Jul 2009 12:07:37 +0200

On Sun, Jul 19, 2009 at 4:39 PM, Robert T.
Short<address@hidden> wrote:
> In my search for Truth and Justice I discovered the following bitshift
> behavior.
>
> Is the following correct?
>
> % This is what MATLAB does and it seems to make sense to me.
> octave:1> bitshift(uint8(0:15),1,3)
> ans =
>
>  0  2  4  6  0  2  4  6  0  2  4  6  0  2  4  6
>
> % MATLAB doesn't support this, but octave does.  Why would shifting
> % a positive signed integer give different results than unsigned?
> octave:2> bitshift(int8(0:15),1,3)
> ans =
>
>  0   2   4   6   8  10  12  14  16  18  20  22  24  26  28  30
>
>
>
>
> I will be out of town for a week.
>
>
> Bob
> --
> Robert T. Short, Ph.D.
> PhaseLocked Systems
>
>

Please check out:
http://hg.savannah.gnu.org/hgweb/octave/rev/357cff83985d

thanks

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]