On Apr 2, 2006, at 9:43 PM, Thomas Cunningham wrote:

I'm trying to get the same functionality of these C++ routines in Rb.

  //#define SET_BIT(word,bit_flag)   ((word)=((word) | (bit_flag)))

For this I have

word = Bitwise.BitOr(word, bit_flag)

Correct?

  //#define RESET_BIT(word,bit_flag) ((word)=((word) & (~bit_flag)))

For this I see no equivalent in Rb for the ~ (tilda) operator which produces an integer with all of the bits set to 1, except the bit that originally was
set to 1, that bit becomes a 0.

bitwise.BitXor(bit_flag , &b11111111)

mike
--
Mike Woodworth
[EMAIL PROTECTED]


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to