octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #36458] Bitset error!


From: Michael Godfrey
Subject: [Octave-bug-tracker] [bug #36458] Bitset error!
Date: Sun, 13 May 2012 15:39:24 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0

Follow-up Comment #2, bug #36458 (project octave):

Matlab (R2009B) says:

>> a=uint8([1,2;3 4])

a =

    1    2
    3    4

>> bitset(a,1,[0 1; 0 1])

ans =

    0    3
    2    5

and:
>> help bitset
 BITSET Set bit.
    C = BITSET(A,BIT) sets bit position BIT in A to 1 (on). A must be an
    unsigned integer or an array of unsigned integers, and BIT must be a 
    number between 1 and the length in bits of the unsigned integer class 
    of A, e.g., 32 for UINT32s.
 
    C = BITSET(A,BIT,V) sets the bit at position BIT to the value V.
    V must be either 0 or 1.
 
    Example:
       Repeatedly subtract powers of 2 from the largest UINT32 value:
 
       a = intmax('uint32')
       for i = 1:32, a = bitset(a,32-i+1,0), end
 
    See also BITGET, BITAND, BITOR, BITXOR, BITCMP, BITSHIFT, INTMAX.

So, it is a little unclear what if anything should be
done about this.  Possibly check for valid third argument?

In any case, what was the motivation for a vector third
argument which Matlab does not officially support?


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?36458>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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